support top-level await (#5487)

This commit is contained in:
Alex Lam S.L
2022-06-06 04:52:01 +01:00
committed by GitHub
parent 25441d44f6
commit d2bd0d1c1c
3 changed files with 22 additions and 9 deletions

View File

@@ -2541,7 +2541,10 @@ function parse($TEXT, options) {
return function() {
var start = S.token;
var body = [];
if (options.module) S.input.add_directive("use strict");
if (options.module) {
S.in_async = true;
S.input.add_directive("use strict");
}
S.input.push_directives_stack();
while (!is("eof"))
body.push(statement());