mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-24 02:31:13 +08:00
feat: 函数 length 属性(字节码函数/bind 包装器)+ getter/setter name 前缀
This commit is contained in:
@@ -52,6 +52,8 @@ pub struct IRFunction {
|
||||
pub needs_home_object: bool,
|
||||
pub captured_this_const_idx: u16,
|
||||
pub function_name: Option<String>,
|
||||
/// 函数 `length` 属性值:第一个带默认值/解构默认的形参之前的形参数(rest 不计)。
|
||||
pub function_length: u32,
|
||||
/// 本函数是否为顶层脚本函数:顶层 STORE_VAR 写全局可观察状态,不可被精确 DCE
|
||||
/// 删除;函数内局部 STORE_VAR 才可删。emit 在 assemble_ir 处由
|
||||
/// `parent_ctx.is_none()` 填充;nested/手工构造默认 false。
|
||||
@@ -80,6 +82,7 @@ impl IRFunction {
|
||||
needs_home_object: false,
|
||||
captured_this_const_idx: 0,
|
||||
function_name: None,
|
||||
function_length: 0,
|
||||
is_top_level: false,
|
||||
const_overflow: false,
|
||||
nested: Vec::new(),
|
||||
|
||||
@@ -85,6 +85,7 @@ pub fn lower(f: &IRFunction) -> Result<CompiledModule, String> {
|
||||
is_arrow: f.is_arrow,
|
||||
captured_this_const_idx: f.captured_this_const_idx,
|
||||
function_name: f.function_name.clone(),
|
||||
function_length: f.function_length,
|
||||
is_class_constructor: f.is_class_constructor,
|
||||
is_derived_constructor: f.is_derived_constructor,
|
||||
needs_home_object: f.needs_home_object,
|
||||
|
||||
Reference in New Issue
Block a user