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

Tests for functions only referred to by other functions in same scope with extra properties #530

Open
overlookmotel opened this issue Oct 15, 2023 · 0 comments
Labels
dev Issue related to dev or tests

Comments

@overlookmotel
Copy link
Owner

The following works, but I'm not sure if there are tests for it:

Input:

const x = 1;
function f() { return x; }
function f2() { return x + f.y; }
f.y = 100;
export default f2;

Output:

const scopeIndex = ((x, f$0) => [
  f$0 = function f() { return x; },
  function f2() { return x + f$0.y; }
])(1);
Object.assign(scopeIndex[0], {y: 100});
export default scopeIndex[1];

If there are not tests already, add some. It would be easy for #426 to break this.

@overlookmotel overlookmotel added the dev Issue related to dev or tests label Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev Issue related to dev or tests
Projects
None yet
Development

No branches or pull requests

1 participant