From 279d90ec220aa7a63c438242f62135808c154abd Mon Sep 17 00:00:00 2001 From: David Wendt Date: Fri, 21 Feb 2020 14:55:14 -0500 Subject: [PATCH] Remove `define_value` from AVM2 objects. We already have a menagerie of `install_*` functions for adding static properties to a an object; and we don't have to support any kind of asinine nonsense liks `ASSetPropFlags` here. Ergo, we don't need this. --- core/src/avm2/object.rs | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/core/src/avm2/object.rs b/core/src/avm2/object.rs index 7f97ddaba..09119aaf8 100644 --- a/core/src/avm2/object.rs +++ b/core/src/avm2/object.rs @@ -4,14 +4,12 @@ use crate::avm2::function::{ Avm2ClassEntry, Avm2Function, Avm2MethodEntry, Executable, FunctionObject, }; use crate::avm2::names::{Multiname, Namespace, QName}; -use crate::avm2::property::Attribute; use crate::avm2::return_value::ReturnValue; use crate::avm2::scope::Scope; use crate::avm2::script_object::ScriptObject; use crate::avm2::value::{abc_default_value, Value}; use crate::avm2::{Avm2, Error}; use crate::context::UpdateContext; -use enumset::EnumSet; use gc_arena::{Collect, GcCell, MutationContext}; use ruffle_macros::enum_trait_object; use std::fmt::Debug; @@ -97,26 +95,6 @@ pub trait TObject<'gc>: 'gc + Collect + Debug + Into> + Clone + Copy /// `get`. fn proto(&self) -> Option>; - /// Define a value on an object. - /// - /// Unlike setting a value, this function is intended to replace any - /// existing virtual or built-in properties already installed on a given - /// object. As such, this should not run any setters; the resulting name - /// slot should either be completely replaced with the value or completely - /// untouched. - /// - /// It is not guaranteed that all objects accept value definitions, - /// especially if a property name conflicts with a built-in property, such - /// as `__proto__`. - fn define_value( - &self, - gc_context: MutationContext<'gc, '_>, - name: &QName, - value: Value<'gc>, - attributes: EnumSet, - ) { - } - /// Install a method (or any other non-slot value) on an object. fn install_method(&mut self, mc: MutationContext<'gc, '_>, name: QName, function: Object<'gc>);