fix: 块级 let/const/class 预声明 + TDZ 读取运行时抛 ReferenceError

This commit is contained in:
2026-08-10 21:07:39 +08:00
parent a968b89658
commit 973778f181
9 changed files with 237 additions and 8 deletions
+1
View File
@@ -9,6 +9,7 @@ impl Emitter {
return Ok(None);
};
ctx.push_scope();
self.predeclare_lexical_declarations(&block.body, ctx);
let mut r = None;
for s in &block.body {
if let Some(rr) = self.emit_statement(s, ctx)? {