Skip to content

XS: Object rest incorrectly accepts complex assignment targets #155

Description

@bakkot

There's an Early Error which forbids ({ ...{} } = {}), but XS allows it.

({ ...[a = 0] } = {}) is also forbidden by the grammar, but instead of being a Syntax Error, XS gives me TypeError: (host): C: xsCall: no function.

Same thing for bindings.

I think a reasonably complete listing of cases is

// legal
({ ...a } = {});
({ ...(a) } = {});
({ ...((a)) } = {});
({ ...a.b } = {});
({ ...(a.b) } = {});
let { ...a } = {};

// forbidden
({ ...{} } = {});
({ ...[] } = {});
({ ...a = 0 } = {});
let { ...{} } = {};
let { ...[] } = {};
let { ...a } = {};
let { ...(a) } = {};
let { ...a.b } = {};

I'm guessing some of these are missing from test262.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixed - please verifyIssue has been fixed. Please verify and close.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions