From c720481ae5cc38c7cdf45b07e8a2c3c828997729 Mon Sep 17 00:00:00 2001 From: pjh456 <147148383@qq.com> Date: Tue, 30 Jun 2026 15:46:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20error=20=E5=AE=9E=E4=BE=8B=E4=B8=8D?= =?UTF-8?q?=E5=86=8D=E8=AE=BE=20own=20name=20=E5=B1=9E=E6=80=A7=EF=BC=8Cna?= =?UTF-8?q?me=20=E7=94=B1=E5=8E=9F=E5=9E=8B=E6=8F=90=E4=BE=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/oxide_builtins/src/error.rs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/crates/oxide_builtins/src/error.rs b/crates/oxide_builtins/src/error.rs index 80dc5584..dd04eb23 100644 --- a/crates/oxide_builtins/src/error.rs +++ b/crates/oxide_builtins/src/error.rs @@ -41,19 +41,9 @@ pub fn create_kind_error(host: &mut H, kind: &str, msg: &str) -> JsVa .alloc(JsObject::new_empty(EMPTY_SHAPE_ID, JsValue::from_js_object(proto_ptr))); let sf = Arc::clone(host.kernel_core().perm_interner()); let sh = Arc::clone(host.kernel_core().shape_forge()); - // 设置 .name = kind (ES spec: Error.prototype.name) - { - let si_name = sf.intern("name").0; - let shape = sh.make_shape(EMPTY_SHAPE_ID, si_name); - let name_val = host.new_string(kind); - unsafe { - (*obj).set_shape_id(shape); - (*obj).push_prop(name_val); - } - } if !msg.is_empty() { let si_msg = sf.intern("message").0; - let shape = sh.make_shape(unsafe { (*obj).shape_id() }, si_msg); + let shape = sh.make_shape(EMPTY_SHAPE_ID, si_msg); let msg_val = host.new_string(msg); unsafe { (*obj).set_shape_id(shape);