mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-26 03:31:12 +08:00
fix: f64 转字符串 ryu 路径负数改追加防破坏非空缓冲前缀
This commit is contained in:
@@ -115,6 +115,16 @@ fn json_stringify_array() {
|
||||
assert_eq!(s, "[1,2,3]");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn json_stringify_array_with_negative_double() {
|
||||
// 数组内负 double:out 已含 "[1,",负号必须追加在当前数前(ryu 路径)。
|
||||
let mut vm = Vm::new();
|
||||
let result = eval(&mut vm, "JSON.stringify([1,-1.5])").unwrap();
|
||||
assert!(result.is_string());
|
||||
let s = string_value(&vm, result);
|
||||
assert_eq!(s, "[1,-1.5]");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn json_stringify_string() {
|
||||
let mut vm = Vm::new();
|
||||
|
||||
Reference in New Issue
Block a user