fixed behavioural change accidentally introduced by #1348, thanks @satyr
This commit is contained in:
parent
a024ec5b27
commit
6c9ef76b95
|
@ -1702,7 +1702,7 @@
|
|||
if (this.isExistentialEquals) {
|
||||
return new If(new Existence(fst).invert(), this.second, {
|
||||
type: 'if'
|
||||
}).compile(o);
|
||||
}).addElse(fst).compile(o);
|
||||
} else {
|
||||
return new If(new Existence(fst), ref, {
|
||||
type: 'if'
|
||||
|
|
|
@ -1317,7 +1317,7 @@ exports.Op = class Op extends Base
|
|||
fst = @first
|
||||
ref = fst
|
||||
if @isExistentialEquals
|
||||
new If(new Existence(fst).invert(), @second, type: 'if').compile o
|
||||
new If(new Existence(fst).invert(), @second, type: 'if').addElse(fst).compile o
|
||||
else
|
||||
new If(new Existence(fst), ref, type: 'if').addElse(@second).compile o
|
||||
|
||||
|
|
|
@ -268,3 +268,9 @@ test "existential assignment", ->
|
|||
eq nonce, c
|
||||
d ?= nonce
|
||||
eq nonce, d
|
||||
|
||||
test "#1348, #1216: existential assignment comilation", ->
|
||||
nonce = {}
|
||||
a = nonce
|
||||
b = (a ?= 0)
|
||||
eq nonce, b
|
||||
|
|
Loading…
Reference in New Issue