aboutsummaryrefslogtreecommitdiff
path: root/src/js_ast.zig
diff options
context:
space:
mode:
authorGravatar Dylan Conway <35280289+dylan-conway@users.noreply.github.com> 2023-05-15 21:50:44 -0700
committerGravatar GitHub <noreply@github.com> 2023-05-15 21:50:44 -0700
commit9c85483a8199f67feb4bebcb88fcc1bed5687916 (patch)
treefa03b9ed2591244f9df8aaf1e4242338c4b96c05 /src/js_ast.zig
parent29572737ab81b6d2864ce1cb835879d7f45a32ae (diff)
downloadbun-9c85483a8199f67feb4bebcb88fcc1bed5687916.tar.gz
bun-9c85483a8199f67feb4bebcb88fcc1bed5687916.tar.zst
bun-9c85483a8199f67feb4bebcb88fcc1bed5687916.zip
handle printing missing expressions and add tests (#2872)
* handle missing expressions and add tests * minify missing expression blocks in parser
Diffstat (limited to 'src/js_ast.zig')
-rw-r--r--src/js_ast.zig4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/js_ast.zig b/src/js_ast.zig
index 4b5c3b812..58f5efae2 100644
--- a/src/js_ast.zig
+++ b/src/js_ast.zig
@@ -2594,6 +2594,10 @@ pub const Stmt = struct {
return self.data == .s_expr and self.data.s_expr.value.data == .e_call and self.data.s_expr.value.data.e_call.target.data == .e_super;
}
+ pub fn isMissingExpr(self: Stmt) bool {
+ return self.data == .s_expr and self.data.s_expr.value.data == .e_missing;
+ }
+
pub fn empty() Stmt {
return Stmt{ .data = .{ .s_empty = None }, .loc = logger.Loc{} };
}