aboutsummaryrefslogtreecommitdiff
path: root/tools/js-optimizer.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/js-optimizer.js')
-rw-r--r--tools/js-optimizer.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js
index 150b1c37..6cd1fbcc 100644
--- a/tools/js-optimizer.js
+++ b/tools/js-optimizer.js
@@ -527,6 +527,10 @@ function optimizeShifts(ast) {
var total = 0;
if (node[3][0] == 'num' && node[2][3][0] == 'num') {
total = ['num', sign1*node[3][1] + sign2*node[2][3][1]];
+ if (total[1] < 0) {
+ combinedShift = '<<';
+ total[1] *= -1;
+ }
if (total[1] == 0) {
// XXX this may be wrong, if we removed a |0 that assumed we had this >> which |0's anyhow!
return node[2][2];