Truly independent web browser
LibJS: Cache missing properties of arguments objects and typed arrays
Tim Ledbetter39137a0ba3f2
diff --git a/Libraries/LibJS/Rust/src/runtime/arguments_object.rs b/Libraries/LibJS/Rust/src/runtime/arguments_object.rsindex 80d441c65c9..d294e9695d2 100644--- a/Libraries/LibJS/Rust/src/runtime/arguments_object.rs+++ b/Libraries/LibJS/Rust/src/runtime/arguments_object.rs@@ -54,7 +54,7 @@ pub static ARGUMENTS_OBJECT_METHODS: ObjectMethods = ObjectMethods {internal_get_own_property: ArgumentsObject::internal_get_own_property,internal_define_own_property: ArgumentsObject::internal_define_own_property,internal_get: ArgumentsObject::internal_get,- is_cacheable_for_property_absence: |_| false,+ is_cacheable_for_absence_of: |_, _, property_key| !property_key.is_number(),internal_set: ArgumentsObject::internal_set,internal_delete: ArgumentsObject::internal_delete,..ORDINARY_OBJECT_METHODSdiff --git a/Libraries/LibJS/Rust/src/runtime/object.rs b/Libraries/LibJS/Rust/src/runtime/object.rsindex 007ea650484..b6269d972be 100644--- a/Libraries/LibJS/Rust/src/runtime/object.rs+++ b/Libraries/LibJS/Rust/src/runtime/object.rs@@ -2465,7 +2465,7 @@ impl Object {let this_value = Value::from_object(self.as_gc());let mut prototype = self.internal_get_prototype_of(vm)?;while let Some(current) = prototype {- if !current.is_cacheable_for_property_absence() {+ if !current.is_cacheable_for_absence_of(vm, property_key) {return current.internal_set(vm,property_key,diff --git a/Libraries/LibJS/Rust/src/runtime/typed_array.rs b/Libraries/LibJS/Rust/src/runtime/typed_array.rsindex 928cf00b4d0..a36ebf509bd 100644--- a/Libraries/LibJS/Rust/src/runtime/typed_array.rs+++ b/Libraries/LibJS/Rust/src/runtime/typed_array.rs@@ -138,7 +138,10 @@ pub static TYPED_ARRAY_BASE_METHODS: ObjectMethods = ObjectMethods {internal_has_property: TypedArrayBase::internal_has_property,internal_define_own_property: TypedArrayBase::internal_define_own_property,internal_get: TypedArrayBase::internal_get,- is_cacheable_for_property_absence: |_| false,+ is_cacheable_for_absence_of: |_, _, property_key| {+ property_key.is_symbol()+ || canonical_numeric_index_string(property_key, CanonicalIndexMode::DetectNumericRoundtrip).is_undefined()+ },internal_set: TypedArrayBase::internal_set,internal_delete: TypedArrayBase::internal_delete,internal_own_property_keys: TypedArrayBase::internal_own_property_keys,