Skip to content

Commit

Permalink
Fix bigint print
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed May 26, 2020
1 parent 35a79ce commit b99fb70
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/language-js/printer-estree.js
Original file line number Diff line number Diff line change
Expand Up @@ -1613,14 +1613,18 @@ function printPathNoParens(path, options, print, args) {
case "NumericLiteral": // Babel 6 Literal split
return printNumber(n.extra.raw);
case "BigIntLiteral":
// babel: n.extra.raw, typescript: n.raw, flow: n.bigint
return (n.bigint || (n.extra ? n.extra.raw : n.raw)).toLowerCase();
// babel: n.extra.raw, flow: n.bigint
return (n.bigint || n.extra.raw).toLowerCase();
case "BooleanLiteral": // Babel 6 Literal split
case "StringLiteral": // Babel 6 Literal split
case "Literal": {
if (n.regex) {
return printRegex(n.regex);
}
// typescript
if (n.bigint) {
return n.raw.toLowerCase();
}
if (typeof n.value === "number") {
return printNumber(n.raw);
}
Expand Down

0 comments on commit b99fb70

Please sign in to comment.