-
• #2
I'm not sure what ECMA defines as 'return' from a statement. That's why some languages by definition return self / this except there is a coded return... a default return allows easy and especially with Espruino very fast cascading of messages sent / methods invoked to the very same object...
-
• #3
Interesting... I honestly wasn't aware that
if
statements returned anything - so it doesn't surprise me that it's wrong. It should be a pretty easy fix though. I just added a bug for this: https://github.com/espruino/Espruino/issÂues/909
run in node.js:
run in espruino:
similarly
if (x.b) 4; else 5;
returns 5 in node.js and undefined in Espruino.