mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-25 03:01:12 +08:00
fix: catch 参数名补入捕获扫描且 catch 入口新 cell
This commit is contained in:
@@ -251,6 +251,11 @@ pub(crate) fn collect_decl_names_stmt(stmts: &[Statement], out: &mut HashSet<Str
|
||||
Statement::TryStatement(ts) => {
|
||||
collect_decl_names_stmt(&ts.block.body, out);
|
||||
if let Some(h) = &ts.handler {
|
||||
// catch 参数是本函数作用域的词法绑定:计入 own_bindings,
|
||||
// 嵌套函数引用它时捕获分析才会建 cell 供 upvalue 读取。
|
||||
if let Some(param) = &h.param {
|
||||
collect_binding_pattern_names(¶m.pattern, out);
|
||||
}
|
||||
collect_decl_names_stmt(&h.body.body, out);
|
||||
}
|
||||
if let Some(f) = &ts.finalizer {
|
||||
|
||||
Reference in New Issue
Block a user