boa icon indicating copy to clipboard operation
boa copied to clipboard

[runtime] script evaluation should return the value of last Statement that returns value

Open croraf opened this issue 4 years ago • 4 comments

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.

croraf avatar Jun 05 '20 19:06 croraf

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.

jasonwilliams avatar Jun 07 '20 09:06 jasonwilliams

https://repl.it/@croraf/ImpoliteQualifiedRobodoc @jasonwilliams

croraf avatar Jun 07 '20 10:06 croraf

Thanks for that, I don’t get that locally for some reason. Is this something you wanted to look at @croraf ?

jasonwilliams avatar Jun 07 '20 13:06 jasonwilliams

Maybe related to #1544

jedel1043 avatar Sep 08 '21 04:09 jedel1043

This has been fixed for a while. The example now returs the expected 1.

raskad avatar Sep 29 '23 19:09 raskad