From 8c900f3dce6e410ee18609d3661af3a491ce19b7 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Sun, 21 Sep 2014 17:59:12 -0700 Subject: [PATCH] make detectAsmCoercion not see unary - as double --- tools/js-optimizer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js index c47eac57d..eb5e48375 100644 --- a/tools/js-optimizer.js +++ b/tools/js-optimizer.js @@ -1829,7 +1829,7 @@ var ASM_FLOAT_ZERO = null; // TODO: share the entire node? function detectAsmCoercion(node, asmInfo, inVarDef) { // for params, +x vs x|0, for vars, 0.0 vs 0 if (node[0] === 'num' && node[1].toString().indexOf('.') >= 0) return ASM_DOUBLE; - if (node[0] === 'unary-prefix') return ASM_DOUBLE; + if (node[0] === 'unary-prefix' && node[1] === '+') return ASM_DOUBLE; if (node[0] === 'call' && node[1][0] === 'name' && node[1][1] === 'Math_fround') return ASM_FLOAT; if (asmInfo && node[0] == 'name') return getAsmType(node[1], asmInfo); if (node[0] === 'name') {