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) {
|
if (this.isExistentialEquals) {
|
||||||
return new If(new Existence(fst).invert(), this.second, {
|
return new If(new Existence(fst).invert(), this.second, {
|
||||||
type: 'if'
|
type: 'if'
|
||||||
}).compile(o);
|
}).addElse(fst).compile(o);
|
||||||
} else {
|
} else {
|
||||||
return new If(new Existence(fst), ref, {
|
return new If(new Existence(fst), ref, {
|
||||||
type: 'if'
|
type: 'if'
|
||||||
|
|
|
@ -1317,7 +1317,7 @@ exports.Op = class Op extends Base
|
||||||
fst = @first
|
fst = @first
|
||||||
ref = fst
|
ref = fst
|
||||||
if @isExistentialEquals
|
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
|
else
|
||||||
new If(new Existence(fst), ref, type: 'if').addElse(@second).compile o
|
new If(new Existence(fst), ref, type: 'if').addElse(@second).compile o
|
||||||
|
|
||||||
|
|
|
@ -268,3 +268,9 @@ test "existential assignment", ->
|
||||||
eq nonce, c
|
eq nonce, c
|
||||||
d ?= nonce
|
d ?= nonce
|
||||||
eq nonce, d
|
eq nonce, d
|
||||||
|
|
||||||
|
test "#1348, #1216: existential assignment comilation", ->
|
||||||
|
nonce = {}
|
||||||
|
a = nonce
|
||||||
|
b = (a ?= 0)
|
||||||
|
eq nonce, b
|
||||||
|
|
Loading…
Reference in New Issue