diff options
author | 2023-08-24 23:00:42 -0700 | |
---|---|---|
committer | 2023-08-24 23:00:53 -0700 | |
commit | 16b4bf341acc0f4804f0b6bdf5298c180cd00366 (patch) | |
tree | bb2dbbf4e92d4a9b5feec1f6de0d9772d891b36a /src | |
parent | 1480889205d49cf7221a36608a8896b452967cea (diff) | |
download | bun-16b4bf341acc0f4804f0b6bdf5298c180cd00366.tar.gz bun-16b4bf341acc0f4804f0b6bdf5298c180cd00366.tar.zst bun-16b4bf341acc0f4804f0b6bdf5298c180cd00366.zip |
Disable minifying "str".length until https://github.com/oven-sh/bun/issues/4217 is fixed
Diffstat (limited to 'src')
-rw-r--r-- | src/feature_flags.zig | 2 | ||||
-rw-r--r-- | src/js_parser.zig | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/feature_flags.zig b/src/feature_flags.zig index 130e07d33..0f7e35988 100644 --- a/src/feature_flags.zig +++ b/src/feature_flags.zig @@ -23,6 +23,8 @@ pub const bundle_node_modules = true; pub const tracing = true; +pub const minify_javascript_string_length = false; + pub const verbose_watcher = false; pub const css_supports_fence = true; diff --git a/src/js_parser.zig b/src/js_parser.zig index 68e45ace2..6351aa33b 100644 --- a/src/js_parser.zig +++ b/src/js_parser.zig @@ -17050,10 +17050,13 @@ fn NewParser_( } }, .e_string => |str| { - if (p.options.features.minify_syntax) { - // minify "long-string".length to 11 - if (strings.eqlComptime(name, "length")) { - return p.newExpr(E.Number{ .value = @as(f64, @floatFromInt(str.javascriptLength())) }, loc); + // Disable until https://github.com/oven-sh/bun/issues/4217 is fixed + if (comptime FeatureFlags.minify_javascript_string_length) { + if (p.options.features.minify_syntax) { + // minify "long-string".length to 11 + if (strings.eqlComptime(name, "length")) { + return p.newExpr(E.Number{ .value = @as(f64, @floatFromInt(str.javascriptLength())) }, loc); + } } } }, |