Skip to content

SyntaxError thrown on valid JS #633

@p-bakker

Description

@p-bakker

This snippet of code throws a SyntaxError: invalid lexical variable name:

        with (new Proxy({globalThis: {Infinity, NaN, undefined}}, {})) {
          const {Infinity,NaN,undefined} = this.globalThis;
        }

This sort of structure is used by SES in the Compartment polyfill

Besides this snippet being valid js and thus shouldn't be throwing a SyntaxError, if there would be a real syntax error, shouldn't the error include the invalid variable name?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions