fix: 修复 Object 的输出格式
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user