Skip to content

Commit

Permalink
Fix idempotency
Browse files Browse the repository at this point in the history
  • Loading branch information
lydell committed Jun 6, 2020
1 parent 3818eb6 commit 446fa52
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/language-js/printer-estree.js
Expand Up @@ -3767,9 +3767,14 @@ function printPropertyKey(path, options, print) {
(options.quoteProps === "consistent" && !needsQuoteProps.get(parent)))
) {
// 'a' -> a
// '1e+100' -> 1e+100
// '1e+100' -> 1e100
return path.call(
(keyPath) => comments.printComments(keyPath, () => key.value, options),
(keyPath) =>
comments.printComments(
keyPath,
() => (/^\d/.test(key.value) ? printNumber(key.value) : key.value),
options
),
"key"
);
}
Expand Down

0 comments on commit 446fa52

Please sign in to comment.