diff options
author | kzc <kzc@users.noreply.github.com> | 2017-09-20 12:52:48 -0400 |
---|---|---|
committer | alexlamsl <alexlamsl@gmail.com> | 2017-09-21 04:42:40 +0800 |
commit | 7e3e9da860d9da4fa3d5e37bea4d3bd399194c02 (patch) | |
tree | 942fd6473ff7792be4d07da7296c7cedb7244246 /test/compress/asm.js | |
parent | 00f509405b44882bab5d63d97caacb21691cdad6 (diff) | |
download | tracifyjs-7e3e9da860d9da4fa3d5e37bea4d3bd399194c02.tar.gz tracifyjs-7e3e9da860d9da4fa3d5e37bea4d3bd399194c02.zip |
fix "use asm" numeric output (#2328)
fixes #2324
Diffstat (limited to 'test/compress/asm.js')
-rw-r--r-- | test/compress/asm.js | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/test/compress/asm.js b/test/compress/asm.js index 9b227326..527e6b43 100644 --- a/test/compress/asm.js +++ b/test/compress/asm.js @@ -104,3 +104,65 @@ asm_mixed: { } } +asm_toplevel: { + options = {} + input: { + "use asm"; + 0.0; + function f() { + 0.0; + (function(){ + 0.0; + }); + } + 0.0; + } + expect_exact: '"use asm";0.0;function f(){0.0;(function(){0.0})}0.0;' +} + +asm_function_expression: { + options = {} + input: { + 0.0; + var a = function() { + "use asm"; + 0.0; + } + function f() { + 0.0; + return function(){ + "use asm"; + 0.0; + } + 0.0; + } + 0.0; + } + expect_exact: '0;var a=function(){"use asm";0.0};function f(){0;return function(){"use asm";0.0};0}0;' +} + +asm_nested_functions: { + options = {} + input: { + 0.0; + function a() { + "use asm"; + 0.0; + } + 0.0; + function b() { + 0.0; + function c(){ + "use asm"; + 0.0; + } + 0.0; + function d(){ + 0.0; + } + 0.0; + } + 0.0; + } + expect_exact: '0;function a(){"use asm";0.0}0;function b(){0;function c(){"use asm";0.0}0;function d(){0}0}0;' +} |