Allow overwriting virtual properties via setting `set` to `None`.
This commit is contained in:
parent
feaa3dd203
commit
d35e36def5
|
@ -63,9 +63,16 @@ impl<'gc> Property<'gc> {
|
||||||
new_value: Value<'gc>,
|
new_value: Value<'gc>,
|
||||||
) {
|
) {
|
||||||
match self {
|
match self {
|
||||||
Property::Virtual { set, .. } => {
|
Property::Virtual {
|
||||||
|
set, attributes, ..
|
||||||
|
} => {
|
||||||
if let Some(function) = set {
|
if let Some(function) = set {
|
||||||
function(avm, context, this, &[new_value]);
|
function(avm, context, this, &[new_value]);
|
||||||
|
} else if !attributes.contains(ReadOnly) {
|
||||||
|
*self = Property::Stored {
|
||||||
|
value: new_value,
|
||||||
|
attributes: *attributes,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Property::Stored {
|
Property::Stored {
|
||||||
|
|
Loading…
Reference in New Issue