Commit Graph

16 Commits

Author SHA1 Message Date
pjh123 5df04a8e58 chore: 全仓 rustfmt 格式化归拢 2026-08-16 12:50:36 +08:00
pjh123 07ea7e6d4f fix: TDZ 写与 const 赋值检查补全(含闭包捕获路径) 2026-08-15 21:55:43 +08:00
爱特每羊队 6da248872b feat: emit 模块编译(快照式链接:依赖子模块闭包 + import/export 域)
- emit_program_module:模块顶层编译(is_global_scope=false,顶层 this undefined 由 VM 按标志绑定)
- emit_module_into_ctx:预声明/闭包分析识别 export 包裹声明与 import 绑定
- 依赖收集:import/re-export/star 的 source 去重、循环检测、json/text 数据模块
- 导入绑定初始化:__moduleLinkGet 链接期检查;self-import 别名语义(export 处回写)
- export 域:声明/重导出/export */export default 就地注册命名空间
- re-export 链接检查移至 prelude(先于 body 求值)
- emit_module_call 参数打包连续寄存器(CALL_NATIVE 契约)
- CompileCtx 增 module_ns_reg/module_dep_ns_regs/self-import 映射
- 拆分 declaration helper(export 声明复用);function/class 表达式 emitter 提升可见性
2026-08-12 17:37:33 +08:00
爱特每羊队 7055ef1fbb fix: 块级 let/const/class 预声明 + TDZ 读取运行时抛 ReferenceError 2026-08-10 21:07:39 +08:00
爱特每羊队 06951dcec3 feat: 循环 let/const 每迭代绑定(MAKE_CELL_FRESH + 解构捕获修复) 2026-08-10 10:18:39 +08:00
爱特每羊队 4d37614e49 fix: 脚本顶层 var/function 声明落 globalThis(DEFINE_GLOBAL_PROP 非可配置数据属性) 2026-08-10 03:52:17 +08:00
爱特每羊队 8f8c9a39ff feat: 解构模式语义补齐(REST 枚举/getter/computed 排除、IteratorClose、RegAlloc def 干涉、for-in 捕获遮蔽) 2026-08-09 15:01:31 +08:00
爱特每羊队 2f8f1c3b71 feat: with 语句、成员位/移位复合赋值、CALL_NATIVE 无目标修复
with 语句:新增 emit 支持,with 体内自由标识符动态解析(对象属性优先,
回退外层),支持读/写/复合赋值/自增自减/delete/var 初始化动态化,
TO_OBJECT opcode 处理原始值对象,顶层 this 绑定全局对象。

复合赋值:新增 6 个 COMPOUND_MEMBER_BIT_* opcode 支持成员位/移位复合赋值,
修复 computed member 复合赋值覆盖 bug,with 内标识符复合赋值动态化。

CALL_NATIVE:实现全局 isNaN/isFinite 并绑定,用户覆盖 builtin 名时
回退通用调用路径而非报错,局部遮蔽 builtin 名走普通 CALL。

test262: with 34 pass(基线 0),compound-assignment 320 pass(基线 223)
2026-08-09 07:22:46 +08:00
爱特每羊队 fec6b68ecb fix(emit): 括号包裹的匿名函数参与 name 推断(is_anonymous_function_definition) 2026-08-07 20:27:49 +08:00
爱特每羊队 b49ac29414 fix(emit): 默认参数/解构默认值函数名推断(SetFunctionName) 2026-08-07 20:15:35 +08:00
爱特每羊队 04a6aa10f7 feat(emit): 实现默认参数(形参 initializer 与解构默认值) 2026-08-07 15:26:25 +08:00
爱特每羊队 328b8a3ddc docs: 补充注释与格式化 2026-08-06 23:10:27 +08:00
爱特每羊队 38d6c7a60e refactor(emit): 寄存器号 u8→u32 全链放宽,vreg 化去 checkpoint/reg_overflow(B005) 2026-08-06 16:31:16 +08:00
爱特每羊队 c52bf6313e fix(emit): const 声明 STORE_VAR 恒 b=0,修复寄存器复用触发误抛(B011) 2026-08-06 16:03:09 +08:00
爱特每羊队 f461235f04 docs: 添加 Rustdoc 注释 2026-08-05 21:46:47 +08:00
爱特每羊队 bbdfca1a1c refactor(compiler): 拆分 oxide_emit 为独立 emit pass crate(依赖倒置) 2026-08-05 20:13:18 +08:00