-
-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update: Support top-level await and regexp match indices (#505)
* Update: Support top-level await and regexp match indices * Fix failing test * Fix test * Clean up regex test * Update readme * Update tests/fixtures/ecma-version/13/regexp-match-indices/regexp-match-indices.result.js Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * Update tests/fixtures/ecma-version/13/regexp-match-indices/regexp-match-indices.result.js Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * Ensure top-level await test only runs in modules * Cleanup file structure * Update Acorn Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
- Loading branch information
1 parent
9eff2c7
commit e207bd7
Showing
7 changed files
with
429 additions
and
2 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
183 changes: 183 additions & 0 deletions
183
tests/fixtures/ecma-version/13/modules/top-level-await/top-await.result.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,183 @@ | ||
export default { | ||
"type": "Program", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 12 | ||
} | ||
}, | ||
"range": [ | ||
0, | ||
12 | ||
], | ||
"body": [ | ||
{ | ||
"type": "ExpressionStatement", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 12 | ||
} | ||
}, | ||
"range": [ | ||
0, | ||
12 | ||
], | ||
"expression": { | ||
"type": "AwaitExpression", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 11 | ||
} | ||
}, | ||
"range": [ | ||
0, | ||
11 | ||
], | ||
"argument": { | ||
"type": "CallExpression", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 6 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 11 | ||
} | ||
}, | ||
"range": [ | ||
6, | ||
11 | ||
], | ||
"callee": { | ||
"type": "Identifier", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 6 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 9 | ||
} | ||
}, | ||
"range": [ | ||
6, | ||
9 | ||
], | ||
"name": "foo" | ||
}, | ||
"arguments": [], | ||
"optional": false | ||
} | ||
} | ||
} | ||
], | ||
"sourceType": "script", | ||
"tokens": [ | ||
{ | ||
"type": "Identifier", | ||
"value": "await", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 5 | ||
} | ||
}, | ||
"range": [ | ||
0, | ||
5 | ||
] | ||
}, | ||
{ | ||
"type": "Identifier", | ||
"value": "foo", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 6 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 9 | ||
} | ||
}, | ||
"range": [ | ||
6, | ||
9 | ||
] | ||
}, | ||
{ | ||
"type": "Punctuator", | ||
"value": "(", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 9 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 10 | ||
} | ||
}, | ||
"range": [ | ||
9, | ||
10 | ||
] | ||
}, | ||
{ | ||
"type": "Punctuator", | ||
"value": ")", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 10 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 11 | ||
} | ||
}, | ||
"range": [ | ||
10, | ||
11 | ||
] | ||
}, | ||
{ | ||
"type": "Punctuator", | ||
"value": ";", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 11 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 12 | ||
} | ||
}, | ||
"range": [ | ||
11, | ||
12 | ||
] | ||
} | ||
] | ||
}; |
1 change: 1 addition & 0 deletions
1
tests/fixtures/ecma-version/13/modules/top-level-await/top-await.src.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 @@ | ||
await foo(); |
Oops, something went wrong.