feat: 共享 ThrowTypeError 对象并拆分 arguments callee 四象限

This commit is contained in:
2026-09-26 15:01:50 +00:00
parent d773cc7282
commit de236fb5d1
11 changed files with 138 additions and 67 deletions
+8
View File
@@ -319,6 +319,14 @@ impl Emitter {
})
.count() as u32;
// simple 参数列表:全部形参为无初始值标识符且无 rest(规范
// simpleParameterList)。arguments 对象 callee 形态(数据属性 vs
// 受限访问器)按 strict ‖ !simple 分流,length 口径不可代用
// (f({x}) 的 length 与 n_args 相等但非 simple)。
ctx.has_simple_params = param_specs
.iter()
.all(|spec| matches!(spec, ParamSpec::Identifier { initializer: None, .. }));
// 继承父内置寄存器映射:子模块寄存器文件中,内置标识符(Math、Object 等)
// 解析到父预先分配的槽位。
ctx.scopes.builtin_reg_map = parent_ctx.scopes.builtin_reg_map.clone();