fix: 修复 Object 的输出格式

This commit is contained in:
爱特每羊队
2026-06-07 02:04:57 +08:00
parent 382441bec4
commit 4552bbcc57
+4
View File
@@ -125,6 +125,9 @@ fn format_result(string_forge: &StringForge, val: JsValue) {
}
} else if val.is_object() {
let obj = unsafe { &*val.as_js_object_ptr() };
if obj.is_function() {
println!("[Function]");
} else {
print!("{{");
let count = obj.prop_count() as usize;
let mut first = true;
@@ -141,6 +144,7 @@ fn format_result(string_forge: &StringForge, val: JsValue) {
print_value(string_forge, prop_val);
}
println!("}}");
}
} else if val.is_undefined() {
println!("undefined");
} else {