diff --git a/src/babel/generation/generators/types.js b/src/babel/generation/generators/types.js index a84730394d..6732e6d06b 100644 --- a/src/babel/generation/generators/types.js +++ b/src/babel/generation/generators/types.js @@ -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) { diff --git a/test/core/fixtures/transformation/es6.tail-call/call-apply/expected.js b/test/core/fixtures/transformation/es6.tail-call/call-apply/expected.js index a243561b14..c7dcd045d5 100755 --- a/test/core/fixtures/transformation/es6.tail-call/call-apply/expected.js +++ b/test/core/fixtures/transformation/es6.tail-call/call-apply/expected.js @@ -25,4 +25,4 @@ continue _function; } } -})(1000000) === "foo"; +})(1e6) === "foo"; diff --git a/test/core/fixtures/transformation/es6.tail-call/expressions/expected.js b/test/core/fixtures/transformation/es6.tail-call/expressions/expected.js index 306683936e..1246e98c10 100755 --- a/test/core/fixtures/transformation/es6.tail-call/expressions/expected.js +++ b/test/core/fixtures/transformation/es6.tail-call/expressions/expected.js @@ -26,4 +26,4 @@ continue _function; } } -})(1000000, true) === "foo"; +})(1e6, true) === "foo"; diff --git a/test/core/fixtures/transformation/es6.tail-call/recursion/expected.js b/test/core/fixtures/transformation/es6.tail-call/recursion/expected.js index ebec4402e3..ca30fc0ec7 100755 --- a/test/core/fixtures/transformation/es6.tail-call/recursion/expected.js +++ b/test/core/fixtures/transformation/es6.tail-call/recursion/expected.js @@ -27,4 +27,4 @@ _again = true; continue _function; } -})(1000000, true) === "foo"; +})(1e6, true) === "foo"; diff --git a/test/core/fixtures/transformation/es6.tail-call/try-catch/expected.js b/test/core/fixtures/transformation/es6.tail-call/try-catch/expected.js index 434dad6698..4be762ccb2 100755 --- a/test/core/fixtures/transformation/es6.tail-call/try-catch/expected.js +++ b/test/core/fixtures/transformation/es6.tail-call/try-catch/expected.js @@ -8,7 +8,7 @@ try { return f(n - 1); } catch (e) {} -})(1000000) === "foo"; +})(1e6) === "foo"; (function f(_x) { var _again = true; @@ -29,7 +29,7 @@ continue _function; } } -})(1000000) === "foo"; +})(1e6) === "foo"; (function f(n) { if (n <= 0) { @@ -41,7 +41,7 @@ } catch (e) { return f(n - 1); } finally {} -})(1000000) === "foo"; +})(1e6) === "foo"; (function f(_x2) { var _again2 = true; @@ -60,4 +60,4 @@ continue _function2; } } -})(1000000) === "foo"; +})(1e6) === "foo";