Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to inline where function refers to itself #529

Open
overlookmotel opened this issue Oct 13, 2023 · 0 comments
Open

Failure to inline where function refers to itself #529

overlookmotel opened this issue Oct 13, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@overlookmotel
Copy link
Owner

Input:

const f = (0, () => f);
f.x = 123;
export default f;

Output:

const a = (f => f = (0, () => f))();
Object.assign(a, {x: 123});
export default a;

The output could be a single line:

export default Object.assign((f => f = (0, () => f))(), {x: 123});

Looks like the function's dependency on itself results in f erroneously being identified as requiring its own variable.

@overlookmotel overlookmotel added the bug Something isn't working label Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant