Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9082ef6
commit 6e69209
Showing
7 changed files
with
187 additions
and
23 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
3 changes: 0 additions & 3 deletions
3
...tures/es2017/async-functions/await-inside-parameters-of-async-arrow-function/options.json
This file was deleted.
Oops, something went wrong.
58 changes: 58 additions & 0 deletions
58
...xtures/es2017/async-functions/await-inside-parameters-of-async-arrow-function/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,58 @@ | ||
{ | ||
"type": "File", | ||
"start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, | ||
"errors": [ | ||
"SyntaxError: 'await' is only allowed within async functions (1:11)", | ||
"SyntaxError: await is not allowed in async function parameters (1:11)" | ||
], | ||
"program": { | ||
"type": "Program", | ||
"start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, | ||
"sourceType": "script", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "ExpressionStatement", | ||
"start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, | ||
"expression": { | ||
"type": "ArrowFunctionExpression", | ||
"start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, | ||
"id": null, | ||
"generator": false, | ||
"async": true, | ||
"params": [ | ||
{ | ||
"type": "AssignmentPattern", | ||
"start":7,"end":18,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":18}}, | ||
"left": { | ||
"type": "Identifier", | ||
"start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"x"}, | ||
"name": "x" | ||
}, | ||
"right": { | ||
"type": "AwaitExpression", | ||
"start":11,"end":18,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":18}}, | ||
"argument": { | ||
"type": "NumericLiteral", | ||
"start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, | ||
"extra": { | ||
"rawValue": 2, | ||
"raw": "2" | ||
}, | ||
"value": 2 | ||
} | ||
} | ||
} | ||
], | ||
"body": { | ||
"type": "BlockStatement", | ||
"start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, | ||
"body": [], | ||
"directives": [] | ||
} | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |
10 changes: 3 additions & 7 deletions
10
...abel-parser/test/fixtures/experimental/top-level-await/inside-class-property/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,8 +1,4 @@ | ||
{ | ||
"plugins": [ | ||
"topLevelAwait", | ||
"classProperties" | ||
], | ||
"sourceType": "module", | ||
"throws": "Unexpected token, expected \";\" (2:12)" | ||
} | ||
"plugins": ["topLevelAwati", "classProperties"], | ||
"sourceType": "module" | ||
} |
63 changes: 63 additions & 0 deletions
63
...babel-parser/test/fixtures/experimental/top-level-await/inside-class-property/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,63 @@ | ||
{ | ||
"type": "File", | ||
"start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, | ||
"errors": [ | ||
"SyntaxError: 'await' is only allowed within async functions (2:6)", | ||
"SyntaxError: 'await' is only allowed within async functions (2:6)" | ||
], | ||
"program": { | ||
"type": "Program", | ||
"start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, | ||
"sourceType": "module", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "ExportNamedDeclaration", | ||
"start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, | ||
"specifiers": [], | ||
"source": null, | ||
"declaration": { | ||
"type": "ClassDeclaration", | ||
"start":7,"end":33,"loc":{"start":{"line":1,"column":7},"end":{"line":3,"column":1}}, | ||
"id": { | ||
"type": "Identifier", | ||
"start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"C"}, | ||
"name": "C" | ||
}, | ||
"superClass": null, | ||
"body": { | ||
"type": "ClassBody", | ||
"start":15,"end":33,"loc":{"start":{"line":1,"column":15},"end":{"line":3,"column":1}}, | ||
"body": [ | ||
{ | ||
"type": "ClassProperty", | ||
"start":19,"end":31,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, | ||
"static": false, | ||
"key": { | ||
"type": "Identifier", | ||
"start":19,"end":20,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"p"}, | ||
"name": "p" | ||
}, | ||
"computed": false, | ||
"value": { | ||
"type": "AwaitExpression", | ||
"start":23,"end":30,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":13}}, | ||
"argument": { | ||
"type": "NumericLiteral", | ||
"start":29,"end":30,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":13}}, | ||
"extra": { | ||
"rawValue": 0, | ||
"raw": "0" | ||
}, | ||
"value": 0 | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |
8 changes: 2 additions & 6 deletions
8
packages/babel-parser/test/fixtures/typescript/module-namespace/top-level-await/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,8 +1,4 @@ | ||
{ | ||
"sourceType": "module", | ||
"plugins": [ | ||
"typescript", | ||
"topLevelAwait" | ||
], | ||
"throws": "Unexpected token, expected \";\" (2:20)" | ||
} | ||
"plugins": ["typescript", "topLevelAwait"] | ||
} |
60 changes: 60 additions & 0 deletions
60
packages/babel-parser/test/fixtures/typescript/module-namespace/top-level-await/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,60 @@ | ||
{ | ||
"type": "File", | ||
"start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, | ||
"errors": [ | ||
"SyntaxError: 'await' is only allowed within async functions and at the top levels of modules (2:14)" | ||
], | ||
"program": { | ||
"type": "Program", | ||
"start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, | ||
"sourceType": "module", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "TSModuleDeclaration", | ||
"start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, | ||
"id": { | ||
"type": "Identifier", | ||
"start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"N"}, | ||
"name": "N" | ||
}, | ||
"body": { | ||
"type": "TSModuleBlock", | ||
"start":12,"end":39,"loc":{"start":{"line":1,"column":12},"end":{"line":3,"column":1}}, | ||
"body": [ | ||
{ | ||
"type": "VariableDeclaration", | ||
"start":18,"end":37,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":23}}, | ||
"declarations": [ | ||
{ | ||
"type": "VariableDeclarator", | ||
"start":24,"end":36,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":22}}, | ||
"id": { | ||
"type": "Identifier", | ||
"start":24,"end":25,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"x"}, | ||
"name": "x" | ||
}, | ||
"init": { | ||
"type": "AwaitExpression", | ||
"start":28,"end":36,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":22}}, | ||
"argument": { | ||
"type": "NumericLiteral", | ||
"start":34,"end":36,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":22}}, | ||
"extra": { | ||
"rawValue": 42, | ||
"raw": "42" | ||
}, | ||
"value": 42 | ||
} | ||
} | ||
} | ||
], | ||
"kind": "const" | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |