fix: backport #5775
This commit is contained in:
parent
90f2fad8ea
commit
607cf64c22
|
|
@ -1358,6 +1358,9 @@ function OutputStream(options) {
|
|||
DEFPRINT(AST_Const, function(self, output){
|
||||
self._do_print(output, "const");
|
||||
});
|
||||
DEFPRINT(AST_BigInt, function(output) {
|
||||
output.print(this.value + "n");
|
||||
});
|
||||
DEFPRINT(AST_Import, function(self, output) {
|
||||
output.print("import");
|
||||
output.space();
|
||||
|
|
|
|||
|
|
@ -412,7 +412,8 @@ function tokenizer($TEXT, filename, html5_comments, shebang) {
|
|||
var valid = parse_js_number(num);
|
||||
if (isNaN(valid)) parse_error("Invalid syntax: " + num);
|
||||
if (has_dot || has_e || peek() != "n") return token("num", valid);
|
||||
return token("bigint", num.toLowerCase() + next());
|
||||
next();
|
||||
return token("bigint", num.toLowerCase());
|
||||
};
|
||||
|
||||
function read_escaped_char(in_string) {
|
||||
|
|
|
|||
|
|
@ -44,3 +44,17 @@ Number: {
|
|||
expect_stdout: "-1148098955808013200"
|
||||
node_version: ">=10"
|
||||
}
|
||||
|
||||
issue_5728: {
|
||||
options = {
|
||||
evaluate: true,
|
||||
}
|
||||
input: {
|
||||
console.log("" + 4n + 2);
|
||||
}
|
||||
expect: {
|
||||
console.log("42");
|
||||
}
|
||||
expect_stdout: "42"
|
||||
node_version: ">=10.4.0"
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user