I think I understand why is this bug happen. At call.js file, isFinal variable checks whether creator block or not, it works fine for if statement, but not for switch, because its creator is undefined for some reason. I tried to change .every(parent => parent.creator === "block"); with .every(parent => parent.type === "block"); , and everything was working as expected, but I broke some tests =(
I can take a look why does creator variable is undefined for switch statement
https://hegel.js.org/try#C4TwDgpgBAcghsKBeKBGKAfKAmAULgMwFcA7AY2AEsB7EqYCAZ2AAoA3OAGwC5YEBKKAG8oAelFQA7gCdaAc3rgIuKKqiNJlYGQAW7LoKEq1JsnEbRUvaRGBFpdAOSpHxk6rMWc12-afZXdzUAEwgCOCJOYB87ByhHQLUAX1wkoA
I think I understand why is this bug happen. At
call.js
file,isFinal
variable checks whether creator block or not, it works fine for if statement, but not for switch, because its creator isundefined
for some reason. I tried to change.every(parent => parent.creator === "block");
with.every(parent => parent.type === "block");
, and everything was working as expected, but I broke some tests =(I can take a look why does creator variable is undefined for switch statement