fix corner case in objects (#4416)

fixes #4415
This commit is contained in:
Alex Lam S.L
2020-12-19 16:14:57 +00:00
committed by GitHub
parent 9a5aede941
commit acc2d7d845
2 changed files with 20 additions and 1 deletions

View File

@@ -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, {