aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Dylan Conway <35280289+dylan-conway@users.noreply.github.com> 2023-04-17 15:54:02 -0700
committerGravatar GitHub <noreply@github.com> 2023-04-17 15:54:02 -0700
commita17624942e834875287c2b8b35b45954e91a67c3 (patch)
treefc7f76b315742f4e80d0d8804b310d8e0c597145
parent1ce60275d083665ce0988969c2e97c5fae8daa95 (diff)
downloadbun-a17624942e834875287c2b8b35b45954e91a67c3.tar.gz
bun-a17624942e834875287c2b8b35b45954e91a67c3.tar.zst
bun-a17624942e834875287c2b8b35b45954e91a67c3.zip
make sure `with` is parsed as a block (#2680)
-rw-r--r--src/js_ast.zig1
-rw-r--r--src/js_parser.zig6
2 files changed, 1 insertions, 6 deletions
diff --git a/src/js_ast.zig b/src/js_ast.zig
index 5c95b8f5e..8967d2c6d 100644
--- a/src/js_ast.zig
+++ b/src/js_ast.zig
@@ -5025,7 +5025,6 @@ pub const S = struct {
pub const With = struct {
value: ExprNodeIndex,
body: StmtNodeIndex,
- body_loc: logger.Loc,
};
pub const Try = struct {
diff --git a/src/js_parser.zig b/src/js_parser.zig
index f596c2dcd..a8de35869 100644
--- a/src/js_parser.zig
+++ b/src/js_parser.zig
@@ -8992,14 +8992,10 @@ fn NewParser_(
const test_ = try p.parseExpr(.lowest);
try p.lexer.expect(.t_close_paren);
- const body_loc = p.lexer.loc();
- _ = try p.pushScopeForParsePass(.block, body_loc);
- defer p.popScope();
-
var stmtOpts = ParseStatementOptions{};
const body = try p.parseStmt(&stmtOpts);
- return p.s(S.With{ .body = body, .body_loc = body_loc, .value = test_ }, loc);
+ return p.s(S.With{ .body = body, .value = test_ }, loc);
},
.t_switch => {
try p.lexer.next();