diff options
author | 2023-04-17 18:01:38 -0700 | |
---|---|---|
committer | 2023-04-17 18:01:38 -0700 | |
commit | dec5b07782d80e972885df2a750ffb76ef05a884 (patch) | |
tree | db83614826240cc89939eb80ed5ea7c2a0afa3ff /src | |
parent | b758779c4916a726a26d90b163a4e01dd251ddd5 (diff) | |
download | bun-dec5b07782d80e972885df2a750ffb76ef05a884.tar.gz bun-dec5b07782d80e972885df2a750ffb76ef05a884.tar.zst bun-dec5b07782d80e972885df2a750ffb76ef05a884.zip |
Fix template string folding bug
Diffstat (limited to 'src')
-rw-r--r-- | src/js_ast.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/js_ast.zig b/src/js_ast.zig index 8967d2c6d..e9cb6f2a4 100644 --- a/src/js_ast.zig +++ b/src/js_ast.zig @@ -2085,7 +2085,8 @@ pub const E = struct { allocator: std.mem.Allocator, loc: logger.Loc, ) Expr { - if (this.tag != null) { + if (this.tag != null or !this.head.isUTF8()) { + // we only fold utf-8/ascii for now return Expr{ .data = .{ .e_template = this, @@ -2094,8 +2095,7 @@ pub const E = struct { }; } - // we only fold utf-8/ascii for now - if (this.parts.len == 0 or !this.head.isUTF8()) { + if (this.parts.len == 0) { return Expr.init(E.String, this.head, loc); } |