Skip to content

Commit

Permalink
add more test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Feb 1, 2023
1 parent 5946ee8 commit 097eb45
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 3 deletions.
Expand Up @@ -4,3 +4,9 @@
{
using \u0061wait = h();
}
{
using x, await = h();
}
{
for (using await of []);
}
@@ -1,13 +1,15 @@
{
"type": "File",
"start":0,"end":54,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":6,"column":1,"index":54}},
"start":0,"end":113,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":12,"column":1,"index":113}},
"errors": [
"SyntaxError: 'await' is not allowed to be used as a name in 'using' declarations. (2:8)",
"SyntaxError: 'await' is not allowed to be used as a name in 'using' declarations. (5:8)"
"SyntaxError: 'await' is not allowed to be used as a name in 'using' declarations. (5:8)",
"SyntaxError: 'await' is not allowed to be used as a name in 'using' declarations. (8:11)",
"SyntaxError: 'await' is not allowed to be used as a name in 'using' declarations. (11:13)"
],
"program": {
"type": "Program",
"start":0,"end":54,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":6,"column":1,"index":54}},
"start":0,"end":113,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":12,"column":1,"index":113}},
"sourceType": "script",
"interpreter": null,
"body": [
Expand Down Expand Up @@ -76,6 +78,87 @@
}
],
"directives": []
},
{
"type": "BlockStatement",
"start":55,"end":82,"loc":{"start":{"line":7,"column":0,"index":55},"end":{"line":9,"column":1,"index":82}},
"body": [
{
"type": "VariableDeclaration",
"start":59,"end":80,"loc":{"start":{"line":8,"column":2,"index":59},"end":{"line":8,"column":23,"index":80}},
"declarations": [
{
"type": "VariableDeclarator",
"start":65,"end":66,"loc":{"start":{"line":8,"column":8,"index":65},"end":{"line":8,"column":9,"index":66}},
"id": {
"type": "Identifier",
"start":65,"end":66,"loc":{"start":{"line":8,"column":8,"index":65},"end":{"line":8,"column":9,"index":66},"identifierName":"x"},
"name": "x"
},
"init": null
},
{
"type": "VariableDeclarator",
"start":68,"end":79,"loc":{"start":{"line":8,"column":11,"index":68},"end":{"line":8,"column":22,"index":79}},
"id": {
"type": "Identifier",
"start":68,"end":73,"loc":{"start":{"line":8,"column":11,"index":68},"end":{"line":8,"column":16,"index":73},"identifierName":"await"},
"name": "await"
},
"init": {
"type": "CallExpression",
"start":76,"end":79,"loc":{"start":{"line":8,"column":19,"index":76},"end":{"line":8,"column":22,"index":79}},
"callee": {
"type": "Identifier",
"start":76,"end":77,"loc":{"start":{"line":8,"column":19,"index":76},"end":{"line":8,"column":20,"index":77},"identifierName":"h"},
"name": "h"
},
"arguments": []
}
}
],
"kind": "using"
}
],
"directives": []
},
{
"type": "BlockStatement",
"start":83,"end":113,"loc":{"start":{"line":10,"column":0,"index":83},"end":{"line":12,"column":1,"index":113}},
"body": [
{
"type": "ForOfStatement",
"start":87,"end":111,"loc":{"start":{"line":11,"column":2,"index":87},"end":{"line":11,"column":26,"index":111}},
"await": false,
"left": {
"type": "VariableDeclaration",
"start":92,"end":103,"loc":{"start":{"line":11,"column":7,"index":92},"end":{"line":11,"column":18,"index":103}},
"declarations": [
{
"type": "VariableDeclarator",
"start":98,"end":103,"loc":{"start":{"line":11,"column":13,"index":98},"end":{"line":11,"column":18,"index":103}},
"id": {
"type": "Identifier",
"start":98,"end":103,"loc":{"start":{"line":11,"column":13,"index":98},"end":{"line":11,"column":18,"index":103},"identifierName":"await"},
"name": "await"
},
"init": null
}
],
"kind": "using"
},
"right": {
"type": "ArrayExpression",
"start":107,"end":109,"loc":{"start":{"line":11,"column":22,"index":107},"end":{"line":11,"column":24,"index":109}},
"elements": []
},
"body": {
"type": "EmptyStatement",
"start":110,"end":111,"loc":{"start":{"line":11,"column":25,"index":110},"end":{"line":11,"column":26,"index":111}}
}
}
],
"directives": []
}
],
"directives": []
Expand Down

0 comments on commit 097eb45

Please sign in to comment.