You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let stmt = self.parse_statement_list_item(StatementContext::StatementList)?;
59
-
60
-
// Section 11.2.1 Directive Prologue
61
-
// The only way to get a correct directive is to parse the statement first and check if it is a string literal.
62
-
// All other method are flawed, see test cases in [babel](https://github.com/babel/babel/blob/main/packages/babel-parser/test/fixtures/core/categorized/not-directive/input.js)
// span start will mismatch if they are parenthesized when `preserve_parens = false`
67
-
if expr.span.start == string.span.start{
68
-
let src = &self.source_text[string.span.startasusize + 1
69
-
..string.span.endasusize - 1];
70
-
let directive = self.ast.directive(
71
-
expr.span,
72
-
(*string).clone(),
73
-
Atom::from(src),
74
-
);
75
-
directives.push(directive);
76
-
continue;
77
-
}
78
-
}
40
+
if !is_top_level && self.at(Kind::RCurly){
41
+
break;
42
+
}
43
+
let stmt = self.parse_statement_list_item(StatementContext::StatementList)?;
44
+
// Section 11.2.1 Directive Prologue
45
+
// The only way to get a correct directive is to parse the statement first and check if it is a string literal.
46
+
// All other method are flawed, see test cases in [babel](https://github.com/babel/babel/blob/main/packages/babel-parser/test/fixtures/core/categorized/not-directive/input.js)
0 commit comments