-
Notifications
You must be signed in to change notification settings - Fork 845
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
Fix destructuring assignment errors #1529
Fix destructuring assignment errors #1529
Conversation
Nice! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Node d = parser.createDestructuringAssignment(node.getType(), left, right); |
Because a variable declaration cannot be an expression, no
transform
is passed here.
var [a.b] = []; // SyntaxError
@@ -1476,7 +1476,9 @@ private Node createForIn( | |||
Node newBody = new Node(Token.BLOCK); | |||
Node assign; | |||
if (destructuring != -1) { | |||
assign = parser.createDestructuringAssignment(declType, lvalue, id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var a;
for ([a] of [[1], [2], [3]]) {
//
}
@@ -2053,7 +2055,8 @@ private Node createAssignment(int assignType, Node left, Node right) { | |||
parser.reportError("msg.bad.destruct.op"); | |||
return right; | |||
} | |||
return parser.createDestructuringAssignment(-1, left, right); | |||
return parser.createDestructuringAssignment( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var a;
[a] = [1];
@@ -3186,6 +3186,206 @@ language/expressions/arrow-function 209/333 (62.76%) | |||
scope-paramsbody-var-close.js | |||
scope-paramsbody-var-open.js | |||
|
|||
language/expressions/assignment 200/468 (42.74%) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm trying to refresh my memory on test262.properties -- is this a long list of tests that we now have to disable becuase we broke them, or were these tests never run and we're actually able to pass 58% of them?
In other words, do these test262 changes represent an improvement, or a regression?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test262Suite only looks at tests in directories that are already included in trst262.properties
So what you're seeing here in inclusion of a new directory full of tests, some of which already pass
Ran into this recently, tried to create a PR that will include ALL directories automatically, because this is a gap in our 'security net'. Didn't get around to finish it though....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added all directories to test262.properties. ref. #1531
I would like to merge that PR first.
This looks good, but I merged your other 262.properties change and I'd feel better if you looked it over and resolved before merging. Thanks! |
5f55f04
to
d89002d
Compare
I deleted the commit. No other changes have been made. |
Thanks for working on this! |
Closes #1187
This error has been corrected in this commit.
Closes #406
This error has been corrected in this commit.