Having a val declaration, fucks up codegen since the JS that gets generated has return let which is invalid JS. Pattern-match on last expr and disallow this.
val x = if true then {
val y = 10;
} else {
val z = 20;
};
This generates the following JS -
res_42828 = (function() { return let y = 10. })()
^^^
SyntaxError: Unexpected strict mode reserved word
Having a
val
declaration, fucks up codegen since the JS that gets generated hasreturn let
which is invalid JS. Pattern-match on last expr and disallow this.This generates the following JS -