diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/parseTools.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/parseTools.js b/src/parseTools.js index 22e9b94c..cef25ed4 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -1640,7 +1640,10 @@ function getFastValue(a, op, b, type) { } function getFastValues(list, op, type) { - assert(op == '+'); + assert(op === '+' && type === 'i32'); + for (var i = 0; i < list.length; i++) { + if (isNumber(list[i])) list[i] = (list[i]|0) + ''; + } var changed = true; while (changed) { changed = false; @@ -1648,6 +1651,7 @@ function getFastValues(list, op, type) { var fast = getFastValue(list[i], op, list[i+1], type); var raw = list[i] + op + list[i+1]; if (fast.length < raw.length || fast.indexOf(op) < 0) { + if (isNumber(fast)) fast = (fast|0) + ''; list[i] = fast; list.splice(i+1, 1); i--; |