aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Dylan Conway <dylan.conway567@gmail.com> 2023-04-20 01:03:38 -0700
committerGravatar Dylan Conway <dylan.conway567@gmail.com> 2023-04-20 01:03:38 -0700
commit9e7bfdec8cd4fc1827a5d793844afe36638ded37 (patch)
tree4a0049ae62f5cd750833acd7dc6087beb77514d6
parentf0dd5b8a4338814e1c9a56ac900bcd856d624512 (diff)
downloadbun-9e7bfdec8cd4fc1827a5d793844afe36638ded37.tar.gz
bun-9e7bfdec8cd4fc1827a5d793844afe36638ded37.tar.zst
bun-9e7bfdec8cd4fc1827a5d793844afe36638ded37.zip
`with` body can be an expression
-rw-r--r--src/js_parser.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/js_parser.zig b/src/js_parser.zig
index 9e58e5be5..8147ec947 100644
--- a/src/js_parser.zig
+++ b/src/js_parser.zig
@@ -17978,8 +17978,8 @@ fn NewParser_(
// however, old code should still technically transpile
// we do not attempt to preserve all the semantics of with
data.value = p.visitExpr(data.value);
- // This stmt should be a block
- if (comptime Environment.allow_assert) assert(data.body.data == .s_block);
+ // This stmt can be a block or an expression
+ if (comptime Environment.allow_assert) assert(data.body.data == .s_block or data.body.data == .s_expr);
data.body = p.visitSingleStmt(data.body, StmtsKind.none);
},
.s_while => |data| {