fix: 块内函数声明预声明支持(Annex B 块级绑定)
This commit is contained in:
@@ -9,6 +9,9 @@ impl Emitter {
|
||||
return Ok(None);
|
||||
};
|
||||
ctx.push_scope();
|
||||
// 函数预声明先于 lexical:`{ let g; function g(){} }` 时 lexical 的预声明
|
||||
// 命中已存在的函数绑定自然报重复声明错,不被静默覆盖破坏 TDZ。
|
||||
self.predeclare_block_function_declarations(&block.body, ctx);
|
||||
self.predeclare_lexical_declarations(&block.body, ctx);
|
||||
let mut r = None;
|
||||
for s in &block.body {
|
||||
|
||||
Reference in New Issue
Block a user