Add guard against non-ES5 integer literals.
This commit is contained in:
@@ -100,7 +100,7 @@ export function Literal(node) {
|
||||
// check to see if this is the same number as the raw one in the original source as asm.js uses
|
||||
// numbers in the form 5.0 for type hinting
|
||||
var raw = node.raw;
|
||||
if (val === +raw && raw[raw.length - 1] !== ".") {
|
||||
if (val === +raw && raw[raw.length - 1] !== "." && !/^0[bo]/i.test(raw)) {
|
||||
this.push(raw);
|
||||
} else {
|
||||
this.push(val + "");
|
||||
|
||||
@@ -6,3 +6,7 @@
|
||||
null;
|
||||
true;
|
||||
false;
|
||||
5.;
|
||||
0b10;
|
||||
0o70;
|
||||
0X1F;
|
||||
|
||||
@@ -6,3 +6,7 @@
|
||||
null;
|
||||
true;
|
||||
false;
|
||||
5;
|
||||
2;
|
||||
56;
|
||||
0X1F;
|
||||
|
||||
Reference in New Issue
Block a user