We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 712f073 commit fea1656Copy full SHA for fea1656
internal/printer/printer.go
@@ -833,13 +833,13 @@ func (p *Printer) emitLiteral(node *ast.LiteralLikeNode, flags getLiteralTextFla
833
834
func (p *Printer) emitNumericLiteral(node *ast.NumericLiteral) {
835
p.enterNode(node.AsNode())
836
- p.emitLiteral(node.AsNode(), getLiteralTextFlagsNone)
+ p.emitLiteral(node.AsNode(), getLiteralTextFlagsAllowNumericSeparator)
837
p.exitNode(node.AsNode())
838
}
839
840
func (p *Printer) emitBigIntLiteral(node *ast.BigIntLiteral) {
841
842
+ p.emitLiteral(node.AsNode(), getLiteralTextFlagsNone) // TODO: Preserve numeric literal separators after Strada migration
843
844
845
internal/printer/printer_test.go
@@ -21,8 +21,10 @@ func TestEmit(t *testing.T) {
21
}{
22
{title: "StringLiteral#1", input: `;"test"`, output: ";\n\"test\";"},
23
{title: "StringLiteral#2", input: `;'test'`, output: ";\n'test';"},
24
- {title: "NumericLiteral", input: `0`, output: `0;`},
25
- {title: "BigIntLiteral", input: `0n`, output: `0n;`},
+ {title: "NumericLiteral#1", input: `0`, output: `0;`},
+ {title: "NumericLiteral#2", input: `10_000`, output: `10_000;`},
26
+ {title: "BigIntLiteral#1", input: `0n`, output: `0n;`},
27
+ {title: "BigIntLiteral#2", input: `10_000n`, output: `10000n;`}, // TODO: Preserve numeric literal separators after Strada migration
28
{title: "BooleanLiteral#1", input: `true`, output: `true;`},
29
{title: "BooleanLiteral#2", input: `false`, output: `false;`},
30
{title: "NoSubstitutionTemplateLiteral", input: "``", output: "``;"},
0 commit comments