From 09a9d3dfd2823b80665c592ca41eb6b24730bfaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=88=B1=E7=89=B9=E6=AF=8F=E7=BE=8A=E9=98=9F?= Date: Sat, 27 Jun 2026 17:49:36 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E8=87=AA=E5=8A=A8=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/oxide_builtins/src/object.rs | 7 ++++++- crates/oxide_vm/tests/define_property_descriptor_tests.rs | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/crates/oxide_builtins/src/object.rs b/crates/oxide_builtins/src/object.rs index 3126be3..3e6a694 100644 --- a/crates/oxide_builtins/src/object.rs +++ b/crates/oxide_builtins/src/object.rs @@ -288,7 +288,12 @@ pub fn object_define_property(vm: &mut H, args: &[u8]) -> NativeResul } else { if existing_pos.is_none() { if vm - .define_data_property(obj, si, JsValue::undefined(), PropAttributes::new(false, enumerable, configurable)) + .define_data_property( + obj, + si, + JsValue::undefined(), + PropAttributes::new(false, enumerable, configurable), + ) .is_err() { return NativeResult::Err(crate::error::create_type_error(vm, "Cannot define property")); diff --git a/crates/oxide_vm/tests/define_property_descriptor_tests.rs b/crates/oxide_vm/tests/define_property_descriptor_tests.rs index bd53e7b..fa1d5b7 100644 --- a/crates/oxide_vm/tests/define_property_descriptor_tests.rs +++ b/crates/oxide_vm/tests/define_property_descriptor_tests.rs @@ -96,7 +96,11 @@ fn get_own_property_descriptor_accessor_fields() { #[test] fn define_property_new_attributes_only_defaults_value_undefined() { let r = eval_str("var obj={}; Object.defineProperty(obj,'x',{enumerable:true}); obj.x").unwrap(); - assert!(r.is_undefined(), "new prop with only enumerable should default value to undefined, got {:?}", r); + assert!( + r.is_undefined(), + "new prop with only enumerable should default value to undefined, got {:?}", + r + ); } // -- Partial configurable on existing property preserves value --