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 assignment to a target wrapped in multiple parentheses #1256

Open
gibson042 opened this issue Nov 19, 2023 · 0 comments
Labels
confirmed issue reported has been reproduced

Comments

@gibson042
Copy link

Environment: XS 14.2.0 32 4

Description
Simple assignment does not conform with the ECMAScript specification.

Steps to Reproduce

const printEval = src => {
  try {
    print(eval(src));
  } catch (err) {
    print("ERROR", err.message);
  }
};
printEval(`let x = 0; ++(x)`);
printEval(`let x = 0; ++((x))`);
printEval(`let x; (x) = "single-wrapped"`);
printEval(`let x; ((x)) = "double-wrapped"`);

Actual behavior

1
ERROR no reference
single-wrapped
ERROR no reference

Expected behavior

1
1
single-wrapped
double-wrapped

There are early errors for UpdateExpression/AssignmentExpression/etc. with invalid assignment targets, but AssignmentTargetType explicitly recurses into parenthesized expressions. XS correctly respects this for a single level of wrapping parentheses, but incorrectly rejects it for more than one.

test262 pull request: tc39/test262#3963

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