Skip to content

Commit 373bf34

Browse files
committed
move flags to getLiteralTextOfNode
1 parent e7970af commit 373bf34

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

internal/printer/printer.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ func (p *Printer) getLiteralTextOfNode(node *ast.LiteralLikeNode, sourceFile *as
212212
if p.emitContext.EmitFlags(node)&EFNoAsciiEscaping != 0 {
213213
flags |= getLiteralTextFlagsNeverAsciiEscape
214214
}
215+
if p.Options.Target >= core.ScriptTargetES2021 {
216+
flags |= getLiteralTextFlagsAllowNumericSeparator
217+
}
215218
return getLiteralText(node, core.Coalesce(sourceFile, p.currentSourceFile), flags)
216219
}
217220

@@ -999,11 +1002,7 @@ func (p *Printer) emitLiteral(node *ast.LiteralLikeNode, flags getLiteralTextFla
9991002

10001003
func (p *Printer) emitNumericLiteral(node *ast.NumericLiteral) {
10011004
state := p.enterNode(node.AsNode())
1002-
flags := getLiteralTextFlagsNone
1003-
if p.Options.Target >= core.ScriptTargetES2021 {
1004-
flags |= getLiteralTextFlagsAllowNumericSeparator
1005-
}
1006-
p.emitLiteral(node.AsNode(), flags)
1005+
p.emitLiteral(node.AsNode(), getLiteralTextFlagsNone)
10071006
p.exitNode(node.AsNode(), state)
10081007
}
10091008

0 commit comments

Comments
 (0)