fix: f64 转字符串 ryu 路径负数改追加防破坏非空缓冲前缀

This commit is contained in:
2026-08-15 17:35:27 +08:00
parent 3d1ece321b
commit 3eec7fb7ff
5 changed files with 78 additions and 6 deletions
+7
View File
@@ -99,6 +99,13 @@ fn template_with_double_bigint_and_bool() {
assert_eq!(to_str(&vm, result.unwrap()), "a1.5b123ctrued");
}
#[test]
fn template_with_negative_double_appends() {
// 原语段负 double:result 已含 "x",负号必须追加在当前数前(ryu 路径)。
let (vm, result) = eval_val("`x${-1.5}`");
assert_eq!(to_str(&vm, result.unwrap()), "x-1.5");
}
#[test]
fn template_with_object_uses_tostring() {
// 对象段保留完整 ToString(ToPrimitive 触发用户 toString)。