espruino / Espruino

The Espruino JavaScript interpreter - Official Repo
http://www.espruino.com/
Other
2.74k stars 741 forks source link

Potentially inconsistent behaviour when throwing undefined on Linux #2423

Closed marccarigiet closed 8 months ago

marccarigiet commented 8 months ago

-Plattform: [Linux, Ubuntu 20.04]

Description Upon throwing undefined, Espruino exits normally and with a 0 exit code and without any output.

Test case Test code to reproduce the behaviour:

throw undefined;

Expected behaviour Using Espruinos behaviour on the following snippet and other JavaScript Engines as references

throw null;

I would expect a nonzero exit code and "Uncaught undefined" to be outputted.

Additional context This was found using comparative testing between multiple JavaScript engines. This could very much come down to a design choice. I just wanted to let you know in case it is not intentional

gfwilliams commented 8 months ago

Thanks - just fixed