refactor: 函数 strict 标志入 IR/编译/缓存链(零行为地基)

This commit is contained in:
2026-08-16 16:46:33 +08:00
parent a00ef2a7c6
commit 3e071d3337
10 changed files with 89 additions and 20 deletions
+3
View File
@@ -55,6 +55,8 @@ pub struct IRFunction {
pub is_generator: bool,
/// 是否为异步函数体(`async function` / async 箭头)。
pub is_async: bool,
/// 是否为严格模式函数体(自身 "use strict" directive 或外层严格继承,不可解除)。
pub is_strict: bool,
pub captured_this_const_idx: u16,
pub function_name: Option<String>,
/// 函数 `length` 属性值:第一个带默认值/解构默认的形参之前的形参数(rest 不计)。
@@ -87,6 +89,7 @@ impl IRFunction {
needs_home_object: false,
is_generator: false,
is_async: false,
is_strict: false,
captured_this_const_idx: 0,
function_name: None,
function_length: 0,
+1
View File
@@ -86,6 +86,7 @@ pub fn lower(f: &IRFunction) -> Result<CompiledModule, String> {
builtin_reg_map: f.builtin_reg_map.clone(),
sub_modules,
is_arrow: f.is_arrow,
is_strict: f.is_strict,
captured_this_const_idx: f.captured_this_const_idx,
function_name: f.function_name.clone(),
function_length: f.function_length,