@@ -815,7 +815,7 @@ function parse($TEXT, options) {
|
||||
}
|
||||
}
|
||||
|
||||
var statement = embed_tokens(function() {
|
||||
var statement = embed_tokens(function(toplevel) {
|
||||
handle_regexp();
|
||||
switch (S.token.type) {
|
||||
case "string":
|
||||
@@ -854,9 +854,11 @@ function parse($TEXT, options) {
|
||||
if (S.in_async) return simple_statement();
|
||||
break;
|
||||
case "export":
|
||||
if (!toplevel && options.module !== "") unexpected();
|
||||
next();
|
||||
return export_();
|
||||
case "import":
|
||||
if (!toplevel && options.module !== "") unexpected();
|
||||
var token = peek();
|
||||
if (!(token.type == "punc" && /^[(.]$/.test(token.value))) {
|
||||
next();
|
||||
@@ -2563,7 +2565,7 @@ function parse($TEXT, options) {
|
||||
}
|
||||
S.input.push_directives_stack();
|
||||
while (!is("eof"))
|
||||
body.push(statement());
|
||||
body.push(statement(true));
|
||||
S.input.pop_directives_stack();
|
||||
var end = prev() || start;
|
||||
var toplevel = options.toplevel;
|
||||
|
||||
Reference in New Issue
Block a user