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

XS incorrectly rejects undefined bindings #1435

Open
gibson042 opened this issue Nov 23, 2024 · 1 comment
Open

XS incorrectly rejects undefined bindings #1435

gibson042 opened this issue Nov 23, 2024 · 1 comment
Labels
confirmed issue reported has been reproduced

Comments

@gibson042
Copy link

Environment: XS 15.5.1, slot 32 bytes, ID 4 bytes

Description
There are details at tc39/test262#4332 , but the summary is that XS incorrectly fails to create scoped bindings and function parameters named undefined.

Steps to Reproduce

{
  const undefined = 1;
  print(undefined === 1 ? 'PASS' : 'FAIL');
}
(function(undefined) { print(undefined === 1 ? 'PASS' : 'FAIL'); })(1);
(function({ undefined }) { print(undefined === 1 ? 'PASS' : 'FAIL'); })({ undefined: 1 });

Actual behavior

FAIL
FAIL
FAIL

Expected behavior

PASS
PASS
PASS
@gibson042 gibson042 changed the title XS incorrectly rejects NaN/Infinity/undefined bindings XS incorrectly rejects undefined bindings Nov 24, 2024
@phoddie phoddie added the confirmed issue reported has been reproduced label Nov 26, 2024
@phoddie
Copy link
Collaborator

phoddie commented Nov 26, 2024

Thank you for the report. This is caused by a bug in the parser. The fix is to remove a few lines of code. We'll have that in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed issue reported has been reproduced
Projects
None yet
Development

No branches or pull requests

2 participants