-
Notifications
You must be signed in to change notification settings - Fork 482
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
Restore class field tests: public, private (+static) #1660
Conversation
@anba If you have any opportunity to review, I always appreciate your time and efforts :) |
This now contains tests for grammar that's blocked by tc39/proposal-static-class-features#37 I just assume that the issue will be resolved and the syntax will match what is shown in the readme of the proposal. |
1156999
to
a24bba2
Compare
I haven't read any of the test files, but when executing them, I got the following errors. :-) test/language/expressions/class/fields-after-same-line-gen-rs-static-method-privatename-identifier-alt.js
test/language/expressions/class/fields-after-same-line-gen-static-private-methods.js
test/language/expressions/class/fields-computed-name-propname-constructor.js
test/language/expressions/class/static-private-fields-proxy-default-handler-throws.js
test/language/expressions/class/syntax-error-grammar-field-def-has-initializer-no-sc.js
test/language/expressions/class/syntax-error-grammar-field-no-initializer-with-method.js
test/language/expressions/class/syntax-error-grammar-fields.js
Complete errors with stacktraces -> https://gist.github.com/anba/9045b8ce023eabd9cb90920c4427923b |
@anba Thank! I'll check on these today :) |
This was corrected in a recent push to the WIP branch.
This was corrected in a recent push to the WIP branch.
Dropped
Will be fixed in next push
"no semi-colon" ;) ...But I'm seeing now that some of these are missing the offending ClassElement or FieldDefinition necessary for the syntax error exception. I'm going to work on those as well.
This was corrected in a recent push to the WIP branch.
These don't exist anymore, so I guess "problem solved!". I will check to make sure the missing YAML didn't surface in some other files. |
83a999e
to
c0509ff
Compare
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.
All the issues I'm finding are not blockers for moving on. The tests are looking correct.
\u{6F} = 3; | ||
℘ = 4; // DO NOT CHANGE THE NAME OF THIS FIELD | ||
ZW__NJ = 5; // DO NOT CHANGE THE NAME OF THIS FIELD | ||
ZW__J = 6; // DO NOT CHANGE THE NAME OF THIS FIELD |
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 most lovable variable names in the world.
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
desc: SyntaxError |
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 wish the description could be a bit longer here
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
desc: No space allowed between sigial and IdentifierName |
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.
typo, sigial
var x = "string"; | ||
class C { | ||
[x] = /*{ initializer }*/; | ||
} |
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.
thanks for fixing this
---*/ | ||
|
||
//- fields | ||
static async #$(value) { |
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.
It's so weird that we are matching proposals to have static private methods, but in any case, bring it on.
|
||
template: productions | ||
flags: [async] | ||
features: [class-static-methods-private] |
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 glad we have proper flags for these
Updated list of test failures: https://gist.github.com/anba/42051c5232bec1ac5bfde560995ac586 src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case
test/language/expressions/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js (multiple files with the same error)
test/language/expressions/class/fields-after-same-line-gen-static-private-methods.js (multiple files with the same error)
test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier.js (multiple files with the same error)
test/language/statements/class/syntax-invalid-grammar-field-def-has-initializer-no-sc-error.js (multiple files with the same error)
|
That's a reading from @rwaldron of the proposed syntax:
where this reads the sc char in That grammar formatting might need work, but this would be a side-tracking for this PR. If you want to stick to the bikeshedding, we could think on possible alternatives for the trailing
I'm not sure if that really works as the idea is to prevent multiple fields on the same line without a separator, but that's also kind weird as we can stack multiple methods with a field in the same line: As I stated before, I wish the sc could have avoided as an element of ClassElement, but that's a battle lost since ES2015. |
@anba I tried to fix all the parts you mentioned. Can you help me there with another review, please? |
If it helps, I ran the tests using es6draft and found no errors on the tests for this PR. |
# Conflicts: # src/class-fields/init-err-contains-super.case
# Conflicts: # src/class-fields/eval-err-contains-arguments.case # src/class-fields/eval-err-contains-supercall-1.case # src/class-fields/eval-err-contains-supercall-2.case # src/class-fields/eval-err-contains-supercall.case # src/class-fields/eval-err-contains-superproperty-1.case # src/class-fields/eval-err-contains-superproperty-2.case
# Conflicts: # src/class-fields/propname-constructor.case # src/class-fields/propname-error/cls-decl-computed-name.template # src/class-fields/propname-error/cls-decl-literal-name.template # src/class-fields/propname-error/cls-decl-string-name.template # src/class-fields/propname-error/cls-expr-computed-name.template # src/class-fields/propname-error/cls-expr-literal-name.template # src/class-fields/propname-error/cls-expr-string-name.template
# Conflicts: # src/class-fields/propname-error/cls-decl-variable-name.template # src/class-fields/propname-error/cls-expr-variable-name.template
# Conflicts: # src/class-fields/default/cls-decl-after-same-line-async-gen.template # src/class-fields/default/cls-decl-after-same-line-async-method.template # src/class-fields/default/cls-decl-after-same-line-gen.template # src/class-fields/default/cls-decl-after-same-line-method.template # src/class-fields/default/cls-decl-after-same-line-static-async-gen.template # src/class-fields/default/cls-decl-after-same-line-static-async-method.template # src/class-fields/default/cls-decl-after-same-line-static-gen.template # src/class-fields/default/cls-decl-after-same-line-static-method.template # src/class-fields/default/cls-decl-multiple-definitions.template # src/class-fields/default/cls-decl-multiple-stacked-definitions.template # src/class-fields/default/cls-decl-new-no-sc-line-method.template # src/class-fields/default/cls-decl-new-sc-line-generator.template # src/class-fields/default/cls-decl-new-sc-line-method.template # src/class-fields/default/cls-decl-regular-definitions.template # src/class-fields/default/cls-decl-same-line-generator.template # src/class-fields/default/cls-decl-same-line-method.template # src/class-fields/default/cls-decl-wrapped-in-sc.template # src/class-fields/default/cls-expr-after-same-line-async-gen.template # src/class-fields/default/cls-expr-after-same-line-async-method.template # src/class-fields/default/cls-expr-after-same-line-gen.template # src/class-fields/default/cls-expr-after-same-line-method.template # src/class-fields/default/cls-expr-after-same-line-static-async-gen.template # src/class-fields/default/cls-expr-after-same-line-static-async-method.template # src/class-fields/default/cls-expr-after-same-line-static-gen.template # src/class-fields/default/cls-expr-after-same-line-static-method.template # src/class-fields/default/cls-expr-multiple-definitions.template # src/class-fields/default/cls-expr-multiple-stacked-definitions.template # src/class-fields/default/cls-expr-new-no-sc-line-method.template # src/class-fields/default/cls-expr-new-sc-line-generator.template # src/class-fields/default/cls-expr-new-sc-line-method.template # src/class-fields/default/cls-expr-regular-definitions.template # src/class-fields/default/cls-expr-same-line-generator.template # src/class-fields/default/cls-expr-same-line-method.template # src/class-fields/default/cls-expr-wrapped-in-sc.template # src/class-fields/private-names.case
# Conflicts: # test/language/statements/class/classelementname-abrupt-completion.js # test/language/statements/class/fielddefinition-initializer-abrupt-completion.js # test/language/statements/class/super-fielddefinition-initializer-abrupt-completion.js
- needs to use async* to declare async generator methods. - Needs to use yield* if delegating yield semantics are intended. - Has assignment to private name method, which is not allowed and throws a TypeError at runtime. - handle multiple $DONE calls - fix calls to private methods
Travis CI is getting me some weird results as it appears to be comparing with another commit. I'm rebasing this locally and rolling a force push to see if anything changes for Travis. In any case, I have a local backup of the previous commits from this branch. |
bdd4cc5
to
de1bbd6
Compare
The last commits should fix the problem. I had templates using the same path value. Thanks @jugglinmike for helping me finding the bug. |
Hmm, the current version on GH is probably missing some fixes. With my local development version, I still get the following failures: https://gist.github.com/anba/25a51ad514b91870bdcb89f3ad478ed4 Most of the failures happen because |
There seems to be a similar issue in Additionally there are still some invalid property name tests:
|
I see only a single remaining failure ( |
Thanks! I was still working on it, but I wanted to understand what that file was doing. In the process I even found a duplicate for checking privatenames of |
@anba I believe this will be good to go for a final review. Thank you so much for all the support. |
Zero failures with the latest commit! |
I'm getting a pretty positive feedback from parts I can test from other engines, so I'm honestly assuming this is good to ship for now. I'd be happy to address any eventual bug if we find something. |
Most of this was removed previously, but can now be restored and updated.
This is a work in progress
I've tagged @leobalter and @spectranaut for review, but I'm not actually ready for review yet.