Moddable-OpenSource / moddable

Tools for developers to create truly open IoT products using standard JavaScript on low cost microcontrollers.
http://www.moddable.com
1.35k stars 238 forks source link

XS incorrectly rejects `undefined` bindings #1435

Open gibson042 opened 2 days ago

gibson042 commented 2 days ago

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

Description There are details at https://github.com/tc39/test262/issues/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