Skip to content

Commit

Permalink
avm2: Call the Proxy hasProperty override for Object.hasOwnProperty
Browse files Browse the repository at this point in the history
  • Loading branch information
evilpie committed Jul 27, 2024
1 parent 61997e2 commit 1687739
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions core/src/avm2/object/proxy_object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use crate::avm2::activation::Activation;
use crate::avm2::object::script_object::ScriptObjectData;
use crate::avm2::object::{ClassObject, Object, ObjectPtr, QNameObject, TObject};
use crate::avm2::string::AvmString;
use crate::avm2::value::Value;
use crate::avm2::Error;
use crate::avm2::Multiname;
Expand Down Expand Up @@ -145,6 +146,21 @@ impl<'gc> TObject<'gc> for ProxyObject<'gc> {
.coerce_to_boolean())
}

fn has_own_property_string(
self,
name: impl Into<AvmString<'gc>>,
activation: &mut Activation<'_, 'gc>,
) -> Result<bool, Error<'gc>> {
let name = name.into();
Ok(self
.call_property(
&Multiname::new(activation.avm2().proxy_namespace, "hasProperty"),
&[name.into()],
activation,
)?
.coerce_to_boolean())
}

fn get_next_enumerant(
self,
last_index: u32,
Expand Down

0 comments on commit 1687739

Please sign in to comment.