diff --git a/core/src/avm2/globals/boolean.rs b/core/src/avm2/globals/boolean.rs index b2b06aec3..946d890bb 100644 --- a/core/src/avm2/globals/boolean.rs +++ b/core/src/avm2/globals/boolean.rs @@ -82,8 +82,8 @@ fn class_init<'gc>( .into(), activation, )?; - boolean_proto.set_local_property_is_enumerable(gc_context, "toString".into(), false)?; - boolean_proto.set_local_property_is_enumerable(gc_context, "valueOf".into(), false)?; + boolean_proto.set_local_property_is_enumerable(gc_context, "toString".into(), false); + boolean_proto.set_local_property_is_enumerable(gc_context, "valueOf".into(), false); } Ok(Value::Undefined) diff --git a/core/src/avm2/globals/date.rs b/core/src/avm2/globals/date.rs index 0baa85981..e964f2611 100644 --- a/core/src/avm2/globals/date.rs +++ b/core/src/avm2/globals/date.rs @@ -316,7 +316,7 @@ pub fn class_init<'gc>( .into(), activation, )?; - date_proto.set_local_property_is_enumerable(gc_context, (*name).into(), false)?; + date_proto.set_local_property_is_enumerable(gc_context, (*name).into(), false); } } Ok(Value::Undefined) diff --git a/core/src/avm2/globals/function.rs b/core/src/avm2/globals/function.rs index 57eeac149..183acfac0 100644 --- a/core/src/avm2/globals/function.rs +++ b/core/src/avm2/globals/function.rs @@ -64,12 +64,12 @@ pub fn class_init<'gc>( activation.context.gc_context, "call".into(), false, - )?; + ); function_proto.set_local_property_is_enumerable( activation.context.gc_context, "apply".into(), false, - )?; + ); } Ok(Value::Undefined) } diff --git a/core/src/avm2/globals/int.rs b/core/src/avm2/globals/int.rs index ee2dca981..6d2723b53 100644 --- a/core/src/avm2/globals/int.rs +++ b/core/src/avm2/globals/int.rs @@ -120,11 +120,11 @@ fn class_init<'gc>( activation, )?; - int_proto.set_local_property_is_enumerable(gc_context, "toExponential".into(), false)?; - int_proto.set_local_property_is_enumerable(gc_context, "toFixed".into(), false)?; - int_proto.set_local_property_is_enumerable(gc_context, "toPrecision".into(), false)?; - int_proto.set_local_property_is_enumerable(gc_context, "toString".into(), false)?; - int_proto.set_local_property_is_enumerable(gc_context, "valueOf".into(), false)?; + int_proto.set_local_property_is_enumerable(gc_context, "toExponential".into(), false); + int_proto.set_local_property_is_enumerable(gc_context, "toFixed".into(), false); + int_proto.set_local_property_is_enumerable(gc_context, "toPrecision".into(), false); + int_proto.set_local_property_is_enumerable(gc_context, "toString".into(), false); + int_proto.set_local_property_is_enumerable(gc_context, "valueOf".into(), false); } Ok(Value::Undefined) diff --git a/core/src/avm2/globals/number.rs b/core/src/avm2/globals/number.rs index 68d7a4b96..25c8640ab 100644 --- a/core/src/avm2/globals/number.rs +++ b/core/src/avm2/globals/number.rs @@ -118,11 +118,11 @@ fn class_init<'gc>( .into(), activation, )?; - number_proto.set_local_property_is_enumerable(gc_context, "toExponential".into(), false)?; - number_proto.set_local_property_is_enumerable(gc_context, "toFixed".into(), false)?; - number_proto.set_local_property_is_enumerable(gc_context, "toPrecision".into(), false)?; - number_proto.set_local_property_is_enumerable(gc_context, "toString".into(), false)?; - number_proto.set_local_property_is_enumerable(gc_context, "valueOf".into(), false)?; + number_proto.set_local_property_is_enumerable(gc_context, "toExponential".into(), false); + number_proto.set_local_property_is_enumerable(gc_context, "toFixed".into(), false); + number_proto.set_local_property_is_enumerable(gc_context, "toPrecision".into(), false); + number_proto.set_local_property_is_enumerable(gc_context, "toString".into(), false); + number_proto.set_local_property_is_enumerable(gc_context, "valueOf".into(), false); } Ok(Value::Undefined) diff --git a/core/src/avm2/globals/object.rs b/core/src/avm2/globals/object.rs index 365b1514e..eb1c0c4e8 100644 --- a/core/src/avm2/globals/object.rs +++ b/core/src/avm2/globals/object.rs @@ -139,29 +139,21 @@ pub fn class_init<'gc>( activation, )?; - object_proto.set_local_property_is_enumerable( - gc_context, - "hasOwnProperty".into(), - false, - )?; + object_proto.set_local_property_is_enumerable(gc_context, "hasOwnProperty".into(), false); object_proto.set_local_property_is_enumerable( gc_context, "propertyIsEnumerable".into(), false, - )?; + ); object_proto.set_local_property_is_enumerable( gc_context, "setPropertyIsEnumerable".into(), false, - )?; - object_proto.set_local_property_is_enumerable(gc_context, "isPrototypeOf".into(), false)?; - object_proto.set_local_property_is_enumerable(gc_context, "toString".into(), false)?; - object_proto.set_local_property_is_enumerable( - gc_context, - "toLocaleString".into(), - false, - )?; - object_proto.set_local_property_is_enumerable(gc_context, "valueOf".into(), false)?; + ); + object_proto.set_local_property_is_enumerable(gc_context, "isPrototypeOf".into(), false); + object_proto.set_local_property_is_enumerable(gc_context, "toString".into(), false); + object_proto.set_local_property_is_enumerable(gc_context, "toLocaleString".into(), false); + object_proto.set_local_property_is_enumerable(gc_context, "valueOf".into(), false); } Ok(Value::Undefined) @@ -260,7 +252,7 @@ pub fn set_property_is_enumerable<'gc>( let name = name?.coerce_to_string(activation)?; if let Some(Value::Bool(is_enum)) = args.get(1) { - this.set_local_property_is_enumerable(activation.context.gc_context, name, *is_enum)?; + this.set_local_property_is_enumerable(activation.context.gc_context, name, *is_enum); } Ok(Value::Undefined) diff --git a/core/src/avm2/globals/qname.rs b/core/src/avm2/globals/qname.rs index 9efca90ad..3175aabda 100644 --- a/core/src/avm2/globals/qname.rs +++ b/core/src/avm2/globals/qname.rs @@ -99,12 +99,12 @@ pub fn class_init<'gc>( activation.context.gc_context, "toString".into(), false, - )?; + ); qname_proto.set_local_property_is_enumerable( activation.context.gc_context, "valueOf".into(), false, - )?; + ); Ok(Value::Undefined) } diff --git a/core/src/avm2/globals/uint.rs b/core/src/avm2/globals/uint.rs index a97f7fd3f..45b52e064 100644 --- a/core/src/avm2/globals/uint.rs +++ b/core/src/avm2/globals/uint.rs @@ -119,11 +119,11 @@ fn class_init<'gc>( .into(), activation, )?; - uint_proto.set_local_property_is_enumerable(gc_context, "toExponential".into(), false)?; - uint_proto.set_local_property_is_enumerable(gc_context, "toFixed".into(), false)?; - uint_proto.set_local_property_is_enumerable(gc_context, "toPrecision".into(), false)?; - uint_proto.set_local_property_is_enumerable(gc_context, "toString".into(), false)?; - uint_proto.set_local_property_is_enumerable(gc_context, "valueOf".into(), false)?; + uint_proto.set_local_property_is_enumerable(gc_context, "toExponential".into(), false); + uint_proto.set_local_property_is_enumerable(gc_context, "toFixed".into(), false); + uint_proto.set_local_property_is_enumerable(gc_context, "toPrecision".into(), false); + uint_proto.set_local_property_is_enumerable(gc_context, "toString".into(), false); + uint_proto.set_local_property_is_enumerable(gc_context, "valueOf".into(), false); } Ok(Value::Undefined) diff --git a/core/src/avm2/globals/vector.rs b/core/src/avm2/globals/vector.rs index 52d432f21..919c89647 100644 --- a/core/src/avm2/globals/vector.rs +++ b/core/src/avm2/globals/vector.rs @@ -227,7 +227,7 @@ pub fn specialized_class_init<'gc>( activation.context.gc_context, (*pubname).into(), false, - )?; + ); } } diff --git a/core/src/avm2/object.rs b/core/src/avm2/object.rs index bac003821..e7b9387dc 100644 --- a/core/src/avm2/object.rs +++ b/core/src/avm2/object.rs @@ -588,7 +588,7 @@ pub trait TObject<'gc>: 'gc + Collect + Debug + Into> + Clone + Copy mc: MutationContext<'gc, '_>, name: AvmString<'gc>, is_enumerable: bool, - ) -> Result<(), Error> { + ) { let mut base = self.base_mut(mc); base.set_local_property_is_enumerable(name, is_enumerable) diff --git a/core/src/avm2/object/class_object.rs b/core/src/avm2/object/class_object.rs index 6df4fc484..7f29a40df 100644 --- a/core/src/avm2/object/class_object.rs +++ b/core/src/avm2/object/class_object.rs @@ -293,7 +293,7 @@ impl<'gc> ClassObject<'gc> { activation.context.gc_context, "constructor".into(), false, - )?; + ); Ok(()) } @@ -848,11 +848,11 @@ impl<'gc> TObject<'gc> for ClassObject<'gc> { mc: MutationContext<'gc, '_>, name: AvmString<'gc>, is_enumerable: bool, - ) -> Result<(), Error> { + ) { self.0 .write(mc) .base - .set_local_property_is_enumerable(name, is_enumerable) + .set_local_property_is_enumerable(name, is_enumerable); } fn apply( diff --git a/core/src/avm2/object/dictionary_object.rs b/core/src/avm2/object/dictionary_object.rs index d6cf8c6f2..f92f4cbce 100644 --- a/core/src/avm2/object/dictionary_object.rs +++ b/core/src/avm2/object/dictionary_object.rs @@ -142,7 +142,6 @@ impl<'gc> TObject<'gc> for DictionaryObject<'gc> { _mc: MutationContext<'gc, '_>, _name: AvmString<'gc>, _is_enumerable: bool, - ) -> Result<(), Error> { - Ok(()) + ) { } } diff --git a/core/src/avm2/object/script_object.rs b/core/src/avm2/object/script_object.rs index 74d587622..5f17e4dfe 100644 --- a/core/src/avm2/object/script_object.rs +++ b/core/src/avm2/object/script_object.rs @@ -397,11 +397,7 @@ impl<'gc> ScriptObjectData<'gc> { self.enumerants.contains(&name) } - pub fn set_local_property_is_enumerable( - &mut self, - name: AvmString<'gc>, - is_enumerable: bool, - ) -> Result<(), Error> { + pub fn set_local_property_is_enumerable(&mut self, name: AvmString<'gc>, is_enumerable: bool) { if is_enumerable && self.values.contains_key(&name) && !self.enumerants.contains(&name) { self.enumerants.push(name); } else if !is_enumerable && self.enumerants.contains(&name) { @@ -416,8 +412,6 @@ impl<'gc> ScriptObjectData<'gc> { self.enumerants.remove(index); } } - - Ok(()) } /// Gets the number of (standard) enumerants.