dop251/goja

Function with block-scoped assignment inside finally returns wrong value

ftkg opened this issue · 1 comments

ftkg commented
function test() {
  try {
    return 'Hello, world!';
  } finally {
    const dummy = 'unexpected';
  }
}
var a = test();

logger.error(a);

I'm testing with our custom logger, and the value is always "unexpected" using const/let dummy.
It functions as expected if var dummy is used.

Thanks for reporting.