Skip to content

Commit

Permalink
fixed #178
Browse files Browse the repository at this point in the history
  • Loading branch information
satyr committed Oct 15, 2012
1 parent 34de4ee commit 7330542
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/ast.js
Original file line number Diff line number Diff line change
Expand Up @@ -1858,7 +1858,7 @@ exports.Assign = Assign = (function(superclass){
if (this['void'] || !o.level) {
return Parens(Binary('||', test, put)).compile(o);
}
ref$ = test.second.cache(o, true), test.second = ref$[0], left = ref$[1];
ref$ = test.first.cache(o, true), test.first = ref$[0], left = ref$[1];
return If(test, left).addElse(put).compileExpression(o);
};
prototype.compileDestructuring = function(o, left){
Expand Down
2 changes: 1 addition & 1 deletion src/ast.co
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,7 @@ class exports.Assign extends Node
# `a <?= b` => `a <= b || a = b `
return Parens(Binary \|| test, put)compile o if @void or not o.level
# `r = a <?= b` => `r = if a <= b then a else a = b`
[test.second, left] = test.second.cache o, true
[test.first, left] = test.first.cache o, true
If test, left .addElse put .compileExpression o

# Implementation of recursive destructuring,
Expand Down
3 changes: 2 additions & 1 deletion test/operator.co
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,8 @@ u <?= 9
u >?= 0
eq 9, u

eq 99, u >?= 99
eq 99, u >?= 33*3
eq 99, u <?= 33*4
eq 99, u

o = a: 9, b: 0
Expand Down

0 comments on commit 7330542

Please sign in to comment.