From d35e36def5504969d7b1b5e6861a84106d0daa60 Mon Sep 17 00:00:00 2001 From: David Wendt Date: Wed, 9 Oct 2019 20:37:01 -0400 Subject: [PATCH] Allow overwriting virtual properties via setting `set` to `None`. --- core/src/avm1/object.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/src/avm1/object.rs b/core/src/avm1/object.rs index 85c9d9263..0a4b52381 100644 --- a/core/src/avm1/object.rs +++ b/core/src/avm1/object.rs @@ -63,9 +63,16 @@ impl<'gc> Property<'gc> { new_value: Value<'gc>, ) { match self { - Property::Virtual { set, .. } => { + Property::Virtual { + set, attributes, .. + } => { if let Some(function) = set { function(avm, context, this, &[new_value]); + } else if !attributes.contains(ReadOnly) { + *self = Property::Stored { + value: new_value, + attributes: *attributes, + }; } } Property::Stored {