Improve syntax error for class fields in ambient context#12108
Merged
JLHwung merged 2 commits intobabel:mainfrom Sep 26, 2020
Merged
Improve syntax error for class fields in ambient context#12108JLHwung merged 2 commits intobabel:mainfrom
JLHwung merged 2 commits intobabel:mainfrom
Conversation
Collaborator
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/28854/ |
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 05ad22c:
|
existentialism
approved these changes
Sep 25, 2020
JLHwung
reviewed
Sep 25, 2020
| this.parseClassPropertyAnnotation(node); | ||
|
|
||
| if (node.declare && this.match(tt.eq)) { | ||
| if ((node.declare || this.state.isDeclareContext) && this.match(tt.eq)) { |
Contributor
There was a problem hiding this comment.
Does node.declare imply this.state.isDeclareContext? If so we can remove node.declare checks.
Contributor
Author
There was a problem hiding this comment.
No, this.state.isDeclareContext is not for class member with declare modifier.
EDIT:
I've fixed to use this.isDeclareContext for class member with declare modifier at 05ad22c.
nicolo-ribaudo
approved these changes
Sep 26, 2020
3 tasks
sosukesuzuki
added a commit
to sosukesuzuki/prettier
that referenced
this pull request
Oct 15, 2020
sosukesuzuki
added a commit
to prettier/prettier
that referenced
this pull request
Oct 20, 2020
* Install babel/parser 7.12 * Add tests for babel/babel#12161 * Add test for babel/babel#12076 * Add test for babel/babel#12085 * Add test for babel/babel#12108 * Add test for babel/babel#12120 * Add test for babel/babel#12054 * Add test for babel/babel#12061 * Add test babel/babel#12093 * Add test for babel/babel#12065 * Add test for babel/babel#12111 * Add test for babel/babel#12072 * Switch syntax-module-attributes to syntax-import-assertion * Support "String import/export specifier" * Remove tests for module-attributes * Add changelog * Update to 7.12.3 * Fix by linter * Fix by spellchecker * Add tests for module attributes to errors * Add error test for module string name with import * Remove TSTypeCastExpression * Add tests for funny import-assertions * Update snapshots| * Add more tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
'declare' class fields cannot have an initializerInitializers are not allowed in ambient contexts.