aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/js_ast.zig6
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);
}