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;

View file

@ -508,7 +508,7 @@ var Raster = Item.extend(/** @lends Raster# */{
return this.getContext().createImageData(size.width, size.height);
},
// DOCS: document Raster#getData
// DOCS: document Raster#getImageData
/**
* @param {Rectangle} rect
* @return {ImageData}