Skip to content

Commit d189b2e

Browse files
committed
fix a minify bug with quoted property mangling
1 parent 7e8068b commit d189b2e

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

internal/bundler/snapshots/snapshots_loader.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,7 @@ var { [foo("_keepThisProperty")]: x } = y;
873873
foo("_keepThisProperty") in x;
874874

875875
---------- /out/mangle.js ----------
876-
x._mangleThis, x?._mangleThis, x[y ? "a" : z], x?.[y ? "a" : z], x[y ? z : "a"], x?.[y ? z : "a"], x[y, "a"], x?.[y, "a"], "a" + "", (y, "a") + "", class {
876+
x.a, x?.a, x[y ? "a" : z], x?.[y ? "a" : z], x[y ? z : "a"], x?.[y ? z : "a"], x[y, "a"], x?.[y, "a"], "a" + "", (y, "a") + "", class {
877877
a = x;
878878
}, class {
879879
["a"] = x;

internal/js_parser/js_parser.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12522,12 +12522,7 @@ func (p *parser) visitExprInOut(expr js_ast.Expr, in exprIn) (js_ast.Expr, exprO
1252212522
// "a['b']" => "a.b"
1252312523
if p.options.minifySyntax {
1252412524
if str, ok := e.Index.Data.(*js_ast.EString); ok && js_lexer.IsIdentifierUTF16(str.Value) {
12525-
dot := &js_ast.EDot{
12526-
Target: e.Target,
12527-
Name: helpers.UTF16ToString(str.Value),
12528-
NameLoc: e.Index.Loc,
12529-
OptionalChain: e.OptionalChain,
12530-
}
12525+
dot := p.dotOrMangledPropParse(e.Target, js_lexer.MaybeSubstring{String: helpers.UTF16ToString(str.Value)}, e.Index.Loc, e.OptionalChain)
1253112526
if isCallTarget {
1253212527
p.callTarget = dot
1253312528
}

0 commit comments

Comments
 (0)