Skip to content

Commit 7330542

Browse files
committed
fixed #178
1 parent 34de4ee commit 7330542

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

lib/ast.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1858,7 +1858,7 @@ exports.Assign = Assign = (function(superclass){
18581858
if (this['void'] || !o.level) {
18591859
return Parens(Binary('||', test, put)).compile(o);
18601860
}
1861-
ref$ = test.second.cache(o, true), test.second = ref$[0], left = ref$[1];
1861+
ref$ = test.first.cache(o, true), test.first = ref$[0], left = ref$[1];
18621862
return If(test, left).addElse(put).compileExpression(o);
18631863
};
18641864
prototype.compileDestructuring = function(o, left){

src/ast.co

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,7 @@ class exports.Assign extends Node
11211121
# `a <?= b` => `a <= b || a = b `
11221122
return Parens(Binary \|| test, put)compile o if @void or not o.level
11231123
# `r = a <?= b` => `r = if a <= b then a else a = b`
1124-
[test.second, left] = test.second.cache o, true
1124+
[test.first, left] = test.first.cache o, true
11251125
If test, left .addElse put .compileExpression o
11261126

11271127
# Implementation of recursive destructuring,

test/operator.co

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,8 @@ u <?= 9
402402
u >?= 0
403403
eq 9, u
404404

405-
eq 99, u >?= 99
405+
eq 99, u >?= 33*3
406+
eq 99, u <?= 33*4
406407
eq 99, u
407408

408409
o = a: 9, b: 0

0 commit comments

Comments
 (0)