-
Notifications
You must be signed in to change notification settings - Fork 868
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
Shorthand property names #853
Conversation
! dstr-obj-id-put-unresolvable-no-strict.js | ||
! dstr-obj-id-put-unresolvable-strict.js | ||
! dstr-obj-id-simple-no-strict.js | ||
! dstr-obj-id-simple-strict.js |
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.
looks great, seems like many more tests passing. Any idea about this one - why was this passing in the past?
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.
for ({ eval } of [{}]) ;
Previously, it was an error because shorthand was not possible. Correctly, it should be an error because it cannot be assigned to eval
in strict mode.
@@ -2466,7 +2466,7 @@ void decompileObjectLiteral(ObjectLiteral node) { | |||
for (int i = 0; i < size; i++) { | |||
ObjectProperty prop = props.get(i); | |||
boolean destructuringShorthand = | |||
Boolean.TRUE.equals(prop.getProp(Node.DESTRUCTURING_SHORTHAND)); | |||
Boolean.TRUE.equals(prop.getProp(Node.SHORTHAND_PROPERTY_NAME)); |
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.
maybe we need a matching variable name here also
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.
5e9aadf Fixed it.
Looks very promising. Can you look at the "eval" case that @rbri found? I'll test myself and merge next week. Thank you! |
I would like to check the rhino/src/org/mozilla/javascript/IRFactory.java Line 2269 in af35d90
However, It seems that if call
This seems to be the behavior in 1.7R5 as well. |
I found a few other problems and am working on fixing them. (() => { for ({} of []);}).toString();
// {} will disappear
() => {
for (of []) {
}
}
|
OK -- I will hold off on merging until you confirm. Also, we just made a big change to "test262.properties" so please merge with master and re-push when you're ready. |
Thanks! #853 (comment)
This appears to be a rather deep-rooted problem.
If you are interested in fixing it, I will create an issue. |
Can you confirm that this works with the recent changes to test262.properties and then we'll merge? Thanks! |
I rebased on top of master. |
Great -- thanks! |
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer#new_notations_in_ecmascript_2015
We can now do this.
This has always been possible.