mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Correctly handle UpdateExpressions (a++, a--) that are directly following AssignmentExpressions.
Closes #492
This commit is contained in:
parent
6e6df750f0
commit
54f0197eba
1 changed files with 5 additions and 2 deletions
|
@ -229,8 +229,11 @@ Base.exports.PaperScript = (function() {
|
|||
if (node.type === 'UpdateExpression') {
|
||||
if (!node.prefix) {
|
||||
var arg = getCode(node.argument);
|
||||
replaceCode(node, arg + ' = __$__(' + arg + ', "'
|
||||
+ node.operator[0] + '", 1)');
|
||||
var str = arg + ' = __$__(' + arg
|
||||
+ ', "' + node.operator[0] + '", 1)';
|
||||
if (parent.type === 'AssignmentExpression')
|
||||
str = arg + '; ' + str;
|
||||
replaceCode(node, str);
|
||||
}
|
||||
} else { // AssignmentExpression
|
||||
if (/^.=$/.test(node.operator)
|
||||
|
|
Loading…
Reference in a new issue