You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[compiler] Conditional expressions probably need to return undefined by default #45
x=iffalse: 1// x === nully=(->iffalse:
1)()// y === undefined
Wrapping an expression in a function had better not change its value.
Proposed Solution
While trying to work around JavaScript's proliferation of distinct-yet-falsy values may be noble in spirit, the fact that JavaScript returns undefined by default basically forces LSC to do the same for consistency's sake. I think unprovided branches of conditional expressions (if, and possibly match if it doesn't throw-on-else) should be returning undefined to match up with JavaScript core function behavior.
Activity
rattrayalex commentedon Sep 6, 2017
Yeah, agreed. It's a bummer, but it needs to be
undefined. Well said.Missing branches of branching constructs now generate `undefined` ins…
Fast-forward self hoster to 3.0
3.0
3.0
3.1