boa
boa copied to clipboard
[runtime] script evaluation should return the value of last Statement that returns value
Describe the bug https://tc39.es/ecma262/#sec-block-runtime-semantics-evaluation with focus on NOTE 2
To Reproduce
1;
const a = function () {};
Expected behavior Should return 1. Instead undefined is returned.
This isn't really a bug, it should output nothing.
If you run this in Node you won't get 1
as an output either.
https://repl.it/@croraf/ImpoliteQualifiedRobodoc @jasonwilliams
Thanks for that, I don’t get that locally for some reason. Is this something you wanted to look at @croraf ?
Maybe related to #1544
This has been fixed for a while. The example now returs the expected 1
.