mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-27 04:01:11 +08:00
fix: 修复 Object 的输出格式
This commit is contained in:
@@ -125,6 +125,9 @@ fn format_result(string_forge: &StringForge, val: JsValue) {
|
|||||||
}
|
}
|
||||||
} else if val.is_object() {
|
} else if val.is_object() {
|
||||||
let obj = unsafe { &*val.as_js_object_ptr() };
|
let obj = unsafe { &*val.as_js_object_ptr() };
|
||||||
|
if obj.is_function() {
|
||||||
|
println!("[Function]");
|
||||||
|
} else {
|
||||||
print!("{{");
|
print!("{{");
|
||||||
let count = obj.prop_count() as usize;
|
let count = obj.prop_count() as usize;
|
||||||
let mut first = true;
|
let mut first = true;
|
||||||
@@ -141,6 +144,7 @@ fn format_result(string_forge: &StringForge, val: JsValue) {
|
|||||||
print_value(string_forge, prop_val);
|
print_value(string_forge, prop_val);
|
||||||
}
|
}
|
||||||
println!("}}");
|
println!("}}");
|
||||||
|
}
|
||||||
} else if val.is_undefined() {
|
} else if val.is_undefined() {
|
||||||
println!("undefined");
|
println!("undefined");
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user