diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-01-09 10:55:36 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-01-09 10:55:36 -0800 |
commit | b6c33b1fb56211577defda3509129e2395128280 (patch) | |
tree | f603aad5aca8245ec458995eef704c53c7c11cb1 | |
parent | d7c3e10b670e35866b6a50865a0baad225280aeb (diff) |
fix asmEnsureFloat and asmInitializer
-rw-r--r-- | src/parseTools.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/parseTools.js b/src/parseTools.js index d22f4415..c352621d 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -999,7 +999,7 @@ function makeVarDef(js) { function asmEnsureFloat(value, type) { // ensures that a float type has either 5.5 (clearly a float) or +5 (float due to asm coercion) if (!ASM_JS) return value; - if (!isIntImplemented(type) && isNumber(value) && value.toString().indexOf('.') < 0) { + if (type in Runtime.FLOAT_TYPES && isNumber(value) && value.toString().indexOf('.') < 0) { return '(+(' + value + '))'; } else { return value; @@ -1007,10 +1007,10 @@ function asmEnsureFloat(value, type) { // ensures that a float type has either 5 } function asmInitializer(type, impl) { - if (isIntImplemented(type)) {// || (impl && impl == 'VAR_EMULATED')) { - return '0'; - } else { + if (type in Runtime.FLOAT_TYPES) { return '+0'; + } else { + return '0'; } } |