-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement class features in estree (#12370)
Co-authored-by: Kai Cataldo <kai@kaicataldo.com>
- Loading branch information
1 parent
9c567ba
commit 03d7911
Showing
26 changed files
with
656 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
1 change: 1 addition & 0 deletions
1
packages/babel-parser/test/fixtures/estree/class-private-method/basic/input.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
class A { | ||
#foo(arg, ...others) {} | ||
static #bar(arg, ...others) {} | ||
} |
This file contains 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
4 changes: 4 additions & 0 deletions
4
packages/babel-parser/test/fixtures/estree/class-private-property/basic/input.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
class A { | ||
#foo = "bar"; | ||
static #bar = foo; | ||
} |
3 changes: 3 additions & 0 deletions
3
packages/babel-parser/test/fixtures/estree/class-private-property/basic/options.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"plugins": ["estree", "classPrivateProperties"] | ||
} |
61 changes: 61 additions & 0 deletions
61
packages/babel-parser/test/fixtures/estree/class-private-property/basic/output.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{ | ||
"type": "File", | ||
"start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, | ||
"program": { | ||
"type": "Program", | ||
"start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, | ||
"sourceType": "script", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "ClassDeclaration", | ||
"start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, | ||
"id": { | ||
"type": "Identifier", | ||
"start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"A"}, | ||
"name": "A" | ||
}, | ||
"superClass": null, | ||
"body": { | ||
"type": "ClassBody", | ||
"start":8,"end":48,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, | ||
"body": [ | ||
{ | ||
"type": "PropertyDefinition", | ||
"start":12,"end":25,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":15}}, | ||
"static": false, | ||
"key": { | ||
"type": "PrivateIdentifier", | ||
"start":12,"end":16,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":6}}, | ||
"name": "foo" | ||
}, | ||
"value": { | ||
"type": "Literal", | ||
"start":19,"end":24,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":14}}, | ||
"value": "bar", | ||
"raw": "\"bar\"" | ||
}, | ||
"computed": false | ||
}, | ||
{ | ||
"type": "PropertyDefinition", | ||
"start":28,"end":46,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":20}}, | ||
"static": true, | ||
"key": { | ||
"type": "PrivateIdentifier", | ||
"start":35,"end":39,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":13}}, | ||
"name": "bar" | ||
}, | ||
"value": { | ||
"type": "Identifier", | ||
"start":42,"end":45,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":19},"identifierName":"foo"}, | ||
"name": "foo" | ||
}, | ||
"computed": false | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
packages/babel-parser/test/fixtures/estree/class-private-property/flow/input.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class A { | ||
#foo = "bar"; | ||
static #bar = foo; | ||
declare #qux: Array<string>; | ||
} |
3 changes: 3 additions & 0 deletions
3
packages/babel-parser/test/fixtures/estree/class-private-property/flow/options.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"plugins": ["flow", "estree", "classPrivateProperties"] | ||
} |
Oops, something went wrong.