aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-01-21 17:09:01 -0800
committerAlon Zakai <alonzakai@gmail.com>2014-01-21 17:50:46 -0800
commitc744bcec81b3c036f3a434573853baf1bd03d82d (patch)
treeae502b1af75de1cdccdf34b20f71e343a8cc4e12
parentb604a07c61dac68d22542c030cbfb886fbf2a781 (diff)
avoid nonstandard use of splice
-rw-r--r--tools/js-optimizer.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js
index a66fe346..aa1f4a0f 100644
--- a/tools/js-optimizer.js
+++ b/tools/js-optimizer.js
@@ -2306,8 +2306,8 @@ function registerizeHarder(ast) {
node.push(newNode[i]);
i++;
}
- if (i < node.length) {
- node.splice(i);
+ if (node.length > newNode.length) {
+ node.length = newNode.length;
}
}