aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/js_parser.zig5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/js_parser.zig b/src/js_parser.zig
index 38251d42f..9603d2a22 100644
--- a/src/js_parser.zig
+++ b/src/js_parser.zig
@@ -14824,6 +14824,8 @@ fn NewParser_(
pub fn fnBodyContainsUseStrict(body: []Stmt) ?logger.Loc {
for (body) |stmt| {
+ // "use strict" has to appear at the top of the function body
+ // but we can allow comments
switch (stmt.data) {
.s_comment => {
continue;
@@ -14833,7 +14835,8 @@ fn NewParser_(
return stmt.loc;
}
},
- else => {},
+ .s_empty => {},
+ else => return null,
}
}