Add guard against non-ES5 integer literals.

This commit is contained in:
Ingvar Stepanyan
2015-06-17 21:11:20 +03:00
parent d647ede94b
commit 09b334ad21
3 changed files with 9 additions and 1 deletions

View File

@@ -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 + "");