fix up raw number literal

This commit is contained in:
Sebastian McKenzie
2015-06-17 17:58:03 +01:00
parent 6386b60b9a
commit d647ede94b
5 changed files with 12 additions and 8 deletions

View File

@@ -100,7 +100,11 @@ 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;
this.push(val === +raw ? raw : val + "");
if (val === +raw && raw[raw.length - 1] !== ".") {
this.push(raw);
} else {
this.push(val + "");
}
} else if (type === "boolean") {
this.push(val ? "true" : "false");
} else if (node.regex) {