-
-
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.
Enable ergonomic brand checks (
#priv in
) by default (#13554)
* Enable ergonomic brand checks by default in `@babel/parser` * Enable ergonomic brand checks by default in `preset-env` * Fix error position * Update Babel 8 tests
- Loading branch information
1 parent
5f4b58f
commit a254ea3
Showing
180 changed files
with
281 additions
and
61 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
4 changes: 2 additions & 2 deletions
4
...abel-parser/test/fixtures/es2022/class-private-methods/asi-failure-generator/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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token (3:3)" | ||
} | ||
"throws": "Unexpected token (3:9)" | ||
} |
3 changes: 0 additions & 3 deletions
3
...babel-parser/test/fixtures/es2022/class-private-properties/failure-shorthand/options.json
This file was deleted.
Oops, something went wrong.
89 changes: 89 additions & 0 deletions
89
.../babel-parser/test/fixtures/es2022/class-private-properties/failure-shorthand/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,89 @@ | ||
{ | ||
"type": "File", | ||
"start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, | ||
"errors": [ | ||
"SyntaxError: Private names are only allowed in property accesses (`obj.#x`) or in `in` expressions (`#x in obj`). (4:11)" | ||
], | ||
"program": { | ||
"type": "Program", | ||
"start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, | ||
"sourceType": "script", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "ClassDeclaration", | ||
"start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, | ||
"id": { | ||
"type": "Identifier", | ||
"start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9},"identifierName":"Foo"}, | ||
"name": "Foo" | ||
}, | ||
"superClass": null, | ||
"body": { | ||
"type": "ClassBody", | ||
"start":10,"end":56,"loc":{"start":{"line":1,"column":10},"end":{"line":6,"column":1}}, | ||
"body": [ | ||
{ | ||
"type": "ClassPrivateProperty", | ||
"start":14,"end":17,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":5}}, | ||
"static": false, | ||
"key": { | ||
"type": "PrivateName", | ||
"start":14,"end":16,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":4}}, | ||
"id": { | ||
"type": "Identifier", | ||
"start":15,"end":16,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"x"}, | ||
"name": "x" | ||
} | ||
}, | ||
"value": null | ||
}, | ||
{ | ||
"type": "ClassMethod", | ||
"start":20,"end":54,"loc":{"start":{"line":3,"column":2},"end":{"line":5,"column":3}}, | ||
"static": false, | ||
"key": { | ||
"type": "Identifier", | ||
"start":20,"end":31,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":13},"identifierName":"constructor"}, | ||
"name": "constructor" | ||
}, | ||
"computed": false, | ||
"kind": "constructor", | ||
"id": null, | ||
"generator": false, | ||
"async": false, | ||
"params": [], | ||
"body": { | ||
"type": "BlockStatement", | ||
"start":34,"end":54,"loc":{"start":{"line":3,"column":16},"end":{"line":5,"column":3}}, | ||
"body": [ | ||
{ | ||
"type": "ExpressionStatement", | ||
"start":40,"end":50,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":14}}, | ||
"expression": { | ||
"type": "UnaryExpression", | ||
"start":40,"end":49,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":13}}, | ||
"operator": "delete", | ||
"prefix": true, | ||
"argument": { | ||
"type": "PrivateName", | ||
"start":47,"end":49,"loc":{"start":{"line":4,"column":11},"end":{"line":4,"column":13}}, | ||
"id": { | ||
"type": "Identifier", | ||
"start":48,"end":49,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":13},"identifierName":"x"}, | ||
"name": "x" | ||
} | ||
} | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
packages/babel-parser/test/fixtures/estree/private-in/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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"plugins": ["estree", "privateIn"] | ||
"plugins": ["estree"] | ||
} |
7 changes: 0 additions & 7 deletions
7
packages/babel-parser/test/fixtures/experimental/_no-plugin/private-in/input.js
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
packages/babel-parser/test/fixtures/experimental/_no-plugin/private-in/options.json
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
...-parser/test/fixtures/experimental/private-in/private-binary-expression-left/options.json
This file was deleted.
Oops, something went wrong.
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
3 changes: 0 additions & 3 deletions
3
...parser/test/fixtures/experimental/private-in/private-binary-expression-right/options.json
This file was deleted.
Oops, something went wrong.
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
3 changes: 0 additions & 3 deletions
3
packages/babel-parser/test/fixtures/experimental/private-in/private-expression/options.json
This file was deleted.
Oops, something went wrong.
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
3 changes: 0 additions & 3 deletions
3
...babel-parser/test/fixtures/experimental/private-in/private-in-class-heritage/options.json
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
...bel-parser/test/fixtures/experimental/private-in/private-in-escaped-sequence/options.json
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
.../babel-parser/test/fixtures/experimental/private-in/private-in-parenthesized/options.json
This file was deleted.
Oops, something went wrong.
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
3 changes: 0 additions & 3 deletions
3
.../babel-parser/test/fixtures/experimental/private-in/private-in-without-field/options.json
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
packages/babel-parser/test/fixtures/experimental/private-in/private-in/options.json
This file was deleted.
Oops, something went wrong.
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
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
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
Oops, something went wrong.