Commit Graph

33 Commits

Author SHA1 Message Date
pjh123 5de959e2bd fix: String 方法 Symbol 参数抛 TypeError 且缺参按 undefined 查找
as_string 由兜底转换改 Result 化:Symbol 与其余转换失败抛
TypeError,对象 ToString 抛出的原生异常经 take_uncaught_value
原样传播,不再静默降级为空串/占位文本。17 处调用点统一经
try_string! 抛错。

indexOf/includes/startsWith/endsWith/lastIndexOf 删除缺参短路:
searchString 缺省按 ToString(undefined)="undefined" 参与查找,
'undefined'.indexOf() 现得 0。

类正则对象(Object.create(RegExp.prototype))默认 toString 抛
TypeError 的 replace/split 用例随异常传播行为更新断言。
2026-08-16 02:08:13 +08:00
pjh123 e448c642a5 fix: 迭代器原型形状补全(Iterator.prototype/string 中继层/next 原型化) 2026-08-15 23:36:01 +08:00
pjh123 ec32e42ce5 feat: 迭代器原型基建:%IteratorPrototype% 链 + 各集合迭代器原型
新增 %IteratorPrototype%(含 @@iterator 返回自身,经原型链被全部迭代器
继承,it[Symbol.iterator]() === it 恒等)与 %ArrayIteratorPrototype%/
%MapIteratorPrototype%/%SetIteratorPrototype%/%StringIteratorPrototype%/
%RegExpStringIteratorPrototype%(链到 %IteratorPrototype%);Array/Map/Set/
TA/String/matchAll 迭代器包装统一挂对应原型;补 Array/String 的 @@iterator
别名绑定。集合迭代器原型不含 return 方法(规范集合迭代器无 return)。
2026-08-15 22:57:03 +08:00
pjh123 f4e790978d fix: matchAll 空匹配推进至少一个字符,RegExp 补 GC 搬移深拷贝
matchAll 迭代器在空匹配(range.start == range.end)后把游标停在原位置,
同一位置反复空匹配导致死循环;改为按 UTF-8 字符边界推进(与 regress
find_iter 的 next_right_pos 一致),串尾空匹配把游标推到串长之后保证下轮
耗尽。

另修 RegExp 在 GC sweep 与 epoch 晋升中的指针别名:克隆只复制 native_fn 槽
的 Box 指针,源对象释放后克隆持悬垂指针,teardown 双重释放(heap 损坏)。
新增 clone_regexp_native 深拷贝已编译正则,sweep/promote 两处挂接,与
drop 配对保证单次释放。
2026-08-15 20:31:51 +08:00
pjh123 1c70d0343d fix: Function.prototype.apply 解除实参上限,native 大实参集走 spill 溢出区
apply 曾把实参数组静默截断到 55 个(寄存器窗口限制),导致
String.fromCodePoint.apply(null, codePoints) 这类大参数集调用只取前 55 个。
改为直接物化全部实参经 TailCall 下发:字节码目标走帧参数区(spill 栈)任意
个数;native 目标新增 spill 溢出区通道,寄存器窗口(253)之外的实参转存
spill 栈(GC 根、嵌套安全),builtin 经 VmHost::native_arg_count/native_arg_at
读取,String.fromCodePoint 迁移为新接口。大实参集不再静默截断。
2026-08-15 20:31:32 +08:00
pjh123 f63b41454f fix: 字符串索引体系改 UTF-16 code unit 语义(astral 字符正确) 2026-08-15 19:34:55 +08:00
pjh123 b860fdf5ee fix: string.search 无参调用越界 panic,参数读取守卫前置返回 -1 2026-08-15 04:28:01 +08:00
pjh123 57f8a474fa fix: replaceAll 类正则对象统一走 ToString 文本路径与 replace 对齐 2026-08-14 21:15:00 +08:00
pjh123 f7866585d1 perf: replace 函数 replacer 回调免每匹配整串复制
回调第 4 参(原字符串)由每匹配复制整串改为调用方预构一次:
原始字符串 receiver 直接复用原值零拷贝,对象 receiver 提升为单次会话串。
覆盖 String.prototype.replace/replaceAll 与 RegExp.prototype[Symbol.replace]
的函数 replacer 路径。补回调第 4 参断言测试与 fn-replacer 压测。
2026-08-14 21:00:43 +08:00
pjh123 bd9b981362 perf: replace 字符串 pattern 走共享借用零拷贝并修 replace 语义 2026-08-14 12:54:27 +08:00
pjh123 e1747ca560 perf: ASCII 单字符缓存 + 字符串迭代器游标收尾 2026-08-14 12:11:54 +08:00
pjh123 c2aea3f8e9 fix: split 分隔符为 RegExp 子类对象时按字符串语义切分 2026-08-14 10:44:23 +08:00
pjh123 84984f864d perf: 字符串构造类方法改借用免整串拷贝 2026-08-13 23:13:34 +08:00
pjh123 1b6b4e335b perf: 字符串只读扫描方法改借用免整串拷贝 2026-08-13 22:32:38 +08:00
pjh123 3ae2f2d9b7 perf: new_string_owned 零拷贝路径替代 new_string 二次克隆(B2) 2026-08-13 14:55:08 +08:00
爱特每羊队 c4fda0f883 engine: ToPropertyKey via ToPrimitive, Symbol keys/description, catchable conversion errors 2026-08-12 09:59:56 +08:00
爱特每羊队 915dedb151 feat: class 私有成员语义(字段/方法/访问器 + brand 检查 + 契约修复) 2026-08-09 11:08:36 +08:00
爱特每羊队 eefdfc0d2c feat: RegExp.prototype 实现 Symbol.match/replace/search/split/matchAll 2026-08-08 22:33:32 +08:00
爱特每羊队 651b368528 fix: String replace/replaceAll 函数 replacer 路径(含 global 全替换) 2026-08-08 22:05:23 +08:00
爱特每羊队 c3322d6a3c feat: implement String.fromCodePoint, codePointAt UTF-16 indexing, isWellFormed/toWellFormed 2026-08-08 20:05:49 +08:00
爱特每羊队 bf4d4a508d feat(regexp): 迁移到 regress 引擎(backref/lookaround/命名组/v-flag)+ 手动 \$ 展开 replace + exec 捕获组数组 2026-08-07 21:29:22 +08:00
爱特每羊队 e815a56fb9 fix(string): String.prototype 方法 null/undefined this 抛 TypeError 2026-08-07 19:57:24 +08:00
爱特每羊队 ca619d7c06 fix(object): Object() 对原始值创建 boxed 对象 + String 方法 this 完整转换 2026-08-07 19:52:35 +08:00
爱特每羊队 8ac630b4e0 fix(string): String() 对象参数走 ToString 完整转换(数组→join 等) 2026-08-07 19:39:18 +08:00
爱特每羊队 328b8a3ddc docs: 补充注释与格式化 2026-08-06 23:10:27 +08:00
爱特每羊队 f461235f04 docs: 添加 Rustdoc 注释 2026-08-05 21:46:47 +08:00
爱特每羊队 26839db07b style: 自动格式化 2026-06-30 15:11:11 +08:00
爱特每羊队 5ee40c0f34 perf: Date receiver skip + String.replace regex fallback (-100 fail)
(cherry picked from commit 729ee418f3b8061b13ff90524d2a0b051d7bce80)
2026-06-30 12:42:57 +08:00
爱特每羊队 03db51015e fix: as_string uses to_string_full, split regex fallback, undefined sep
(cherry picked from commit 7078a65b9d7055b97bb97232e3426ced4789c26f)
2026-06-30 12:42:57 +08:00
爱特每羊队 f9297097bf fix: 修复 String 原型方法边界条件 2026-06-27 19:45:18 +08:00
爱特每羊队 d17f881327 refactor: 用户数字参数改走 coerce_number_bounded,对象参数支持 ToPrimitive 2026-06-27 13:49:37 +08:00
爱特每羊队 a032a0a0fe feat: 为 Array/String 原型方法添加入口和错误路径结构化日志,编译器添加阶段边界日志 2026-06-26 21:24:18 +08:00
爱特每羊队 2f5d91bd48 feat: 提取 oxide_builtins 独立 crate,泛型化 <H: VmHost> 2026-06-25 22:38:23 +08:00