Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: allow escaped sequence in private in
- Loading branch information
1 parent
dc90c7e
commit a19930f
Showing
4 changed files
with
109 additions
and
1 deletion.
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
6 changes: 6 additions & 0 deletions
6
...s/babel-parser/test/fixtures/experimental/private-in/private-in-escaped-sequence/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,6 @@ | ||
class Foo { | ||
#\u{61} = 1; | ||
test() { | ||
#\u{61} in {}; | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
...bel-parser/test/fixtures/experimental/private-in/private-in-escaped-sequence/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": ["classPrivateProperties", "privateIn"] | ||
} |
98 changes: 98 additions & 0 deletions
98
...abel-parser/test/fixtures/experimental/private-in/private-in-escaped-sequence/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,98 @@ | ||
{ | ||
"type": "File", | ||
"start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, | ||
"program": { | ||
"type": "Program", | ||
"start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, | ||
"sourceType": "script", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "ClassDeclaration", | ||
"start":0,"end":62,"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":62,"loc":{"start":{"line":1,"column":10},"end":{"line":6,"column":1}}, | ||
"body": [ | ||
{ | ||
"type": "ClassPrivateProperty", | ||
"start":14,"end":26,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, | ||
"static": false, | ||
"key": { | ||
"type": "PrivateName", | ||
"start":14,"end":21,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":9}}, | ||
"id": { | ||
"type": "Identifier", | ||
"start":15,"end":21,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":9},"identifierName":"a"}, | ||
"name": "a" | ||
} | ||
}, | ||
"value": { | ||
"type": "NumericLiteral", | ||
"start":24,"end":25,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":13}}, | ||
"extra": { | ||
"rawValue": 1, | ||
"raw": "1" | ||
}, | ||
"value": 1 | ||
} | ||
}, | ||
{ | ||
"type": "ClassMethod", | ||
"start":29,"end":60,"loc":{"start":{"line":3,"column":2},"end":{"line":5,"column":3}}, | ||
"static": false, | ||
"key": { | ||
"type": "Identifier", | ||
"start":29,"end":33,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":6},"identifierName":"test"}, | ||
"name": "test" | ||
}, | ||
"computed": false, | ||
"kind": "method", | ||
"id": null, | ||
"generator": false, | ||
"async": false, | ||
"params": [], | ||
"body": { | ||
"type": "BlockStatement", | ||
"start":36,"end":60,"loc":{"start":{"line":3,"column":9},"end":{"line":5,"column":3}}, | ||
"body": [ | ||
{ | ||
"type": "ExpressionStatement", | ||
"start":42,"end":56,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":18}}, | ||
"expression": { | ||
"type": "BinaryExpression", | ||
"start":42,"end":55,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":17}}, | ||
"left": { | ||
"type": "PrivateName", | ||
"start":42,"end":49,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":11}}, | ||
"id": { | ||
"type": "Identifier", | ||
"start":43,"end":49,"loc":{"start":{"line":4,"column":5},"end":{"line":4,"column":11},"identifierName":"a"}, | ||
"name": "a" | ||
} | ||
}, | ||
"operator": "in", | ||
"right": { | ||
"type": "ObjectExpression", | ||
"start":53,"end":55,"loc":{"start":{"line":4,"column":15},"end":{"line":4,"column":17}}, | ||
"properties": [] | ||
} | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |