Skip to content

Incorrect rejection of non-top-level undefined declarations #370

@gibson042

Description

@gibson042

There are details at tc39/test262#4332 , but the summary is that QuickJS incorrectly rejects as invalid attempts to create scoped declarations named undefined.

For example, this should print "START" and then "PASS", but instead throws a SyntaxError before anything happens (which is only warranted when such a declaration appears at the top-level scope):

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

It may also be worth noting that the analogous NaN and Infinity cases are handled correctly.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions