aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-12-19 16:14:57 +0000
committerGitHub <noreply@github.com>2020-12-20 00:14:57 +0800
commitacc2d7d8455ed7302a78948b3c8678990dc1765a (patch)
tree071b26ecb6ba8456171c9b550a0582d8056a9129 /lib/compress.js
parent9a5aede94147bf5769054fd933b1c15690915d25 (diff)
downloadtracifyjs-acc2d7d8455ed7302a78948b3c8678990dc1765a.tar.gz
tracifyjs-acc2d7d8455ed7302a78948b3c8678990dc1765a.zip
fix corner case in `objects` (#4416)
fixes #4415
Diffstat (limited to 'lib/compress.js')
-rw-r--r--lib/compress.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 1aab3680..5081120c 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -10198,7 +10198,7 @@ merge(Compressor.prototype, {
flush();
values.push(prop);
}
- if (found && !generated && typeof key == "string" && /^[0-9]+$/.test(key)) {
+ if (found && !generated && typeof key == "string" && /^[1-9]*[0-9]$/.test(key)) {
generated = true;
if (keys.has(key)) prop = keys.get(key)[0];
prop.key = make_node(AST_Number, prop, {