Fix issue with PaperScript and array[i++] expressions.

This commit is contained in:
Jürg Lehni 2013-06-18 18:18:39 -07:00
parent 4bda878f5f
commit 3d78e3729d
2 changed files with 6 additions and 1 deletions

View file

@ -137,6 +137,11 @@ var PaperScript = new function() {
// Recursively walks the AST and replaces the code of certain nodes
function walkAst(node) {
// array[i++] is a MemberExpression with computed = true.
// We cannot replace that with array[_$_(i, "+", 1)], as it would
// break the code, so let's bail out.
if (!node || node.type === 'MemberExpression' && node.computed)
return;
for (var key in node) {
if (key === 'range')
continue;