aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-01-07 16:01:08 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-01-07 16:01:08 -0800
commit680d3f7de3dba6c6210350718bf6c99dfc504df0 (patch)
treee3b04014118cf87c2571d4a4d70e180fb5aec50b
parent116eb79d55fd43dfccc8652d530924d02bbd7d58 (diff)
accept either 0.0 or +0 as double in asm coercion
-rw-r--r--tools/js-optimizer.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js
index 77c48a23..103fb1fe 100644
--- a/tools/js-optimizer.js
+++ b/tools/js-optimizer.js
@@ -1251,7 +1251,8 @@ var ASM_INT = 0;
var ASM_DOUBLE = 1;
function detectAsmCoercion(node) {
- // for params, +x vs x|0, for vars, +0 vs 0, so check for "+"
+ // for params, +x vs x|0, for vars, 0.0 vs 0
+ if (node[0] == 'num' && node[1].toString().indexOf('.') >= 0) return ASM_DOUBLE;
return node[0] == 'unary-prefix' ? ASM_DOUBLE : ASM_INT;
}