mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
When emitting block declaration instantiation, we were not calling set_local_initialized() after writing block-scoped function declarations to local variables via Mov. This caused unnecessary ThrowIfTDZ checks to be emitted when those locals were later read. Block-scoped function declarations are always initialized at block entry (via NewFunction + Mov), so TDZ checks for them are redundant.
11 lines
151 B
JavaScript
11 lines
151 B
JavaScript
"use strict";
|
|
function test() {
|
|
let result;
|
|
{
|
|
function foo() { return 42; }
|
|
result = foo();
|
|
}
|
|
return result;
|
|
}
|
|
test();
|