diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/js_printer.zig | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/js_printer.zig b/src/js_printer.zig index f2c9d0ed5..54aa0150c 100644 --- a/src/js_printer.zig +++ b/src/js_printer.zig @@ -1988,8 +1988,14 @@ fn NewPrinter( if (value.loc_ref.ref.?.eql(id.ref)) { if (p.options.commonjs_named_exports_deoptimized or value.needs_decl) { p.printSymbol(p.options.commonjs_named_exports_ref); - p.print("."); - p.print(key); + if (p.canPrintIdentifier(key)) { + p.print("."); + p.print(key); + } else { + p.print("["); + p.printPossiblyEscapedIdentifierString(key, true); + p.print("]"); + } } else { p.printSymbol(value.loc_ref.ref.?); } |