aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-09-24 20:25:38 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-09-24 20:25:38 -0700
commit454b9e41525e40780e80288a83378d128f1cad02 (patch)
tree75a0ecac217eee3b3a3df4738500862edc729bad /src
parent2ec8c7a23fbc1adee266a1e9bf8ac3f24daf3663 (diff)
parent284026de746adf9ce7aafd5da0ce12fd9a3c94f0 (diff)
Merge pull request #1641 from waywardmonkeys/fix-negative-zero-bug
Fix negative zero bug
Diffstat (limited to 'src')
-rw-r--r--src/parseTools.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/parseTools.js b/src/parseTools.js
index ddfb9d01..8ce83adf 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -1499,7 +1499,9 @@ function getFastValue(a, op, b, type) {
}
if (op in MUL_DIV) {
if (op == '*') {
- if (a == 0 || b == 0) {
+ // We can't eliminate where a or b are 0 as that would break things for creating
+ // a negative 0.
+ if ((a == 0 || b == 0) && !(type in Runtime.FLOAT_TYPES)) {
return '0';
} else if (a == 1) {
return b;