aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-12-15 13:23:55 +0000
committerGitHub <noreply@github.com>2020-12-15 21:23:55 +0800
commit549de028b664d565b237ab2c4f79c5ae2f64b1ad (patch)
tree6a37a21eaa94d931bb72e64c409841f940b3c54a /lib
parentf579f1aa47a0ba13955433b90b56bea241849f83 (diff)
downloadtracifyjs-549de028b664d565b237ab2c4f79c5ae2f64b1ad.tar.gz
tracifyjs-549de028b664d565b237ab2c4f79c5ae2f64b1ad.zip
fix corner case in `objects` (#4381)
fixes #4380
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 3e70f2eb..fb5bcb74 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -10118,6 +10118,7 @@ merge(Compressor.prototype, {
}
if (found && !generated && typeof key == "string" && /^[0-9]+$/.test(key)) {
generated = true;
+ if (keys.has(key)) prop = keys.get(key)[0];
prop.key = make_node(AST_Number, prop, {
value: +key
});