Skip to content

Commit 9b6f356

Browse files
avm2: Make TObject::has_own_property_string take an AvmString directly
1 parent ba90a3a commit 9b6f356

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

core/src/avm2/object.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ pub trait TObject<'gc>: 'gc + Collect + Debug + Into<Object<'gc>> + Clone + Copy
386386
/// Same as has_own_property, but constructs a public Multiname for you.
387387
fn has_own_property_string(
388388
self,
389-
name: impl Into<AvmString<'gc>>,
389+
name: AvmString<'gc>,
390390
activation: &mut Activation<'_, 'gc>,
391391
) -> Result<bool, Error<'gc>> {
392392
Ok(self.has_own_property(&Multiname::new(

core/src/avm2/object/proxy_object.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,11 @@ impl<'gc> TObject<'gc> for ProxyObject<'gc> {
141141

142142
fn has_own_property_string(
143143
self,
144-
name: impl Into<AvmString<'gc>>,
144+
name: AvmString<'gc>,
145145
activation: &mut Activation<'_, 'gc>,
146146
) -> Result<bool, Error<'gc>> {
147147
let self_val = Value::from(self);
148148

149-
let name = name.into();
150149
let prop = Multiname::new(activation.avm2().namespaces.proxy, "hasProperty");
151150
Ok(self_val
152151
.call_property(&prop, &[name.into()], activation)?

core/src/avm2/object/xml_list_object.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -633,10 +633,10 @@ impl<'gc> TObject<'gc> for XmlListObject<'gc> {
633633

634634
fn has_own_property_string(
635635
self,
636-
name: impl Into<AvmString<'gc>>,
636+
name: AvmString<'gc>,
637637
activation: &mut Activation<'_, 'gc>,
638638
) -> Result<bool, Error<'gc>> {
639-
let multiname = string_to_multiname(activation, name.into());
639+
let multiname = string_to_multiname(activation, name);
640640
Ok(self.has_own_property(&multiname))
641641
}
642642

core/src/avm2/object/xml_object.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,10 +400,10 @@ impl<'gc> TObject<'gc> for XmlObject<'gc> {
400400

401401
fn has_own_property_string(
402402
self,
403-
name: impl Into<AvmString<'gc>>,
403+
name: AvmString<'gc>,
404404
activation: &mut Activation<'_, 'gc>,
405405
) -> Result<bool, Error<'gc>> {
406-
let multiname = string_to_multiname(activation, name.into());
406+
let multiname = string_to_multiname(activation, name);
407407
Ok(self.has_own_property(&multiname))
408408
}
409409

0 commit comments

Comments
 (0)