Generate original number representation when value was not changed.
This commit is contained in:
@@ -97,7 +97,8 @@ export function Literal(node) {
|
||||
if (type === "string") {
|
||||
this._stringLiteral(val);
|
||||
} else if (type === "number") {
|
||||
this.push(val + "");
|
||||
var raw = node.raw;
|
||||
this.push(val === +raw ? raw : val + "");
|
||||
} else if (type === "boolean") {
|
||||
this.push(val ? "true" : "false");
|
||||
} else if (node.regex) {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
5;
|
||||
5.0;
|
||||
"foobar";
|
||||
"\n\r\u2028\u2029";
|
||||
/foobar/g;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
5;
|
||||
5.0;
|
||||
"foobar";
|
||||
"\n\r\u2028\u2029";
|
||||
/foobar/g;
|
||||
|
||||
Reference in New Issue
Block a user