fix: Object.prototype.toString tags for Math/JSON/Arguments

This commit is contained in:
爱特每羊队
2026-08-12 02:29:40 +08:00
parent 28477a3e47
commit ca293a57e9
3 changed files with 16 additions and 6 deletions
+6
View File
@@ -1011,6 +1011,12 @@ pub fn object_proto_to_string<H: VmHost>(vm: &mut H, args: &[u8]) -> NativeResul
"TypedArray"
} else if obj.is_array_buffer_obj() {
"ArrayBuffer"
} else if obj.is_arguments_obj() {
"Arguments"
} else if std::ptr::eq(ptr, vm.session().builtin_world().math_object.as_ptr()) {
"Math"
} else if std::ptr::eq(ptr, vm.session().builtin_world().json_object.as_ptr()) {
"JSON"
} else {
"Object"
};