Check to make sure that overrides only apply to already-installed properties.
This commit is contained in:
parent
5662527c9e
commit
7d86c93ddc
|
@ -460,6 +460,15 @@ pub trait TObject<'gc>: 'gc + Collect + Debug + Into<Object<'gc>> + Clone + Copy
|
||||||
let receiver = (*self).into();
|
let receiver = (*self).into();
|
||||||
let scope = self.get_scope();
|
let scope = self.get_scope();
|
||||||
let trait_name = trait_entry.name().clone();
|
let trait_name = trait_entry.name().clone();
|
||||||
|
|
||||||
|
if trait_entry.is_override() && !self.has_own_property(&trait_name)? {
|
||||||
|
return Err(format!(
|
||||||
|
"Attempted to override property {:?}, which is not already defined",
|
||||||
|
trait_name
|
||||||
|
)
|
||||||
|
.into());
|
||||||
|
}
|
||||||
|
|
||||||
avm_debug!(
|
avm_debug!(
|
||||||
activation.avm2(),
|
activation.avm2(),
|
||||||
"Installing trait {:?} of kind {:?}",
|
"Installing trait {:?} of kind {:?}",
|
||||||
|
|
Loading…
Reference in New Issue