avm1: Rename StackFrame to Activation now that they're merged

This commit is contained in:
Nathan Adams 2020-07-02 00:09:43 +02:00
parent 9b66b496d0
commit 8bc3eedc43
53 changed files with 660 additions and 660 deletions

View File

@ -16,6 +16,7 @@ mod test_utils;
#[macro_use]
pub mod listeners;
pub mod activation;
pub mod debug;
pub mod error;
mod fscommand;
@ -27,7 +28,6 @@ mod scope;
pub mod script_object;
pub mod shared_object;
mod sound_object;
pub mod stack_frame;
mod stage_object;
mod super_object;
mod value;
@ -39,9 +39,9 @@ pub mod xml_object;
#[cfg(test)]
mod tests;
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::listeners::SystemListener;
use crate::avm1::stack_frame::StackFrame;
pub use globals::SystemPrototypes;
pub use object::{Object, ObjectPtr, TObject};
use scope::Scope;
@ -143,7 +143,7 @@ impl<'gc> Avm1<'gc> {
return;
}
let mut parent_activation = StackFrame::from_nothing(
let mut parent_activation = Activation::from_nothing(
self,
swf_version,
self.global_object_cell(),
@ -163,7 +163,7 @@ impl<'gc> Avm1<'gc> {
),
);
let constant_pool = parent_activation.avm().constant_pool;
let mut child_activation = StackFrame::from_action(
let mut child_activation = Activation::from_action(
parent_activation.avm(),
swf_version,
child_scope,
@ -188,7 +188,7 @@ impl<'gc> Avm1<'gc> {
function: F,
) -> R
where
for<'b> F: FnOnce(&mut StackFrame<'b, 'gc>, &mut UpdateContext<'a, 'gc, '_>) -> R,
for<'b> F: FnOnce(&mut Activation<'b, 'gc>, &mut UpdateContext<'a, 'gc, '_>) -> R,
{
let clip_obj = match active_clip.object() {
Value::Object(o) => o,
@ -202,7 +202,7 @@ impl<'gc> Avm1<'gc> {
action_context.gc_context,
Scope::new(global_scope, scope::ScopeClass::Target, clip_obj),
);
let mut activation = StackFrame::from_action(
let mut activation = Activation::from_action(
self,
swf_version,
child_scope,
@ -229,7 +229,7 @@ impl<'gc> Avm1<'gc> {
return;
}
let mut parent_activation = StackFrame::from_nothing(
let mut parent_activation = Activation::from_nothing(
self,
swf_version,
self.global_object_cell(),
@ -250,7 +250,7 @@ impl<'gc> Avm1<'gc> {
);
parent_activation.avm().push(Value::Undefined);
let constant_pool = parent_activation.avm().constant_pool;
let mut child_activation = StackFrame::from_action(
let mut child_activation = Activation::from_action(
parent_activation.avm(),
swf_version,
child_scope,
@ -282,7 +282,7 @@ impl<'gc> Avm1<'gc> {
return;
}
let mut activation = StackFrame::from_nothing(
let mut activation = Activation::from_nothing(
self,
swf_version,
self.global_object_cell(),
@ -307,7 +307,7 @@ impl<'gc> Avm1<'gc> {
method: &str,
args: &[Value<'gc>],
) {
let mut activation = StackFrame::from_nothing(
let mut activation = Activation::from_nothing(
self,
swf_version,
self.global_object_cell(),
@ -371,7 +371,7 @@ impl<'gc> Avm1<'gc> {
}
pub fn root_error_handler<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
error: Error<'gc>,
) {
@ -399,7 +399,7 @@ fn skip_actions(reader: &mut Reader<'_>, num_actions_to_skip: u8) {
/// Runs via the `startDrag` method or `StartDrag` AVM1 action.
pub fn start_drag<'gc>(
display_object: DisplayObject<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
args: &[Value<'gc>],
) {

View File

@ -90,7 +90,7 @@ enum FrameControl<'gc> {
#[derive(Collect)]
#[collect(no_drop)]
pub struct StackFrame<'a, 'gc: 'a> {
pub struct Activation<'a, 'gc: 'a> {
avm: &'a mut Avm1<'gc>,
/// Represents the SWF version of a given function.
@ -139,7 +139,7 @@ pub struct StackFrame<'a, 'gc: 'a> {
target_clip: Option<DisplayObject<'gc>>,
}
impl<'a, 'gc: 'a> StackFrame<'a, 'gc> {
impl<'a, 'gc: 'a> Activation<'a, 'gc> {
pub fn from_action(
avm: &'a mut Avm1<'gc>,
swf_version: u8,
@ -164,8 +164,8 @@ impl<'a, 'gc: 'a> StackFrame<'a, 'gc> {
}
/// Create a new activation to run a block of code with a given scope.
pub fn with_new_scope<'b>(&'b mut self, scope: GcCell<'gc, Scope<'gc>>) -> StackFrame<'b, 'gc> {
StackFrame {
pub fn with_new_scope<'b>(&'b mut self, scope: GcCell<'gc, Scope<'gc>>) -> Activation<'b, 'gc> {
Activation {
avm: self.avm,
swf_version: self.swf_version,
scope,
@ -216,7 +216,7 @@ impl<'a, 'gc: 'a> StackFrame<'a, 'gc> {
code: SwfSlice,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<ReturnType<'gc>, Error<'gc>> {
let mut parent_activation = StackFrame::from_nothing(
let mut parent_activation = Activation::from_nothing(
self.avm,
swf_version,
self.avm.globals,
@ -235,7 +235,7 @@ impl<'a, 'gc: 'a> StackFrame<'a, 'gc> {
),
);
let constant_pool = parent_activation.avm().constant_pool;
let mut child_activation = StackFrame::from_action(
let mut child_activation = Activation::from_action(
parent_activation.avm(),
swf_version,
child_scope,
@ -256,7 +256,7 @@ impl<'a, 'gc: 'a> StackFrame<'a, 'gc> {
function: F,
) -> R
where
for<'b> F: FnOnce(&mut StackFrame<'b, 'gc>, &mut UpdateContext<'c, 'gc, '_>) -> R,
for<'b> F: FnOnce(&mut Activation<'b, 'gc>, &mut UpdateContext<'c, 'gc, '_>) -> R,
{
let clip_obj = match active_clip.object() {
Value::Object(o) => o,
@ -271,7 +271,7 @@ impl<'a, 'gc: 'a> StackFrame<'a, 'gc> {
Scope::new(global_scope, scope::ScopeClass::Target, clip_obj),
);
let constant_pool = self.avm.constant_pool;
let mut activation = StackFrame::from_action(
let mut activation = Activation::from_action(
self.avm(),
swf_version,
child_scope,

View File

@ -1,4 +1,4 @@
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::activation::Activation;
use crate::avm1::{Object, ObjectPtr, TObject, Value};
use crate::context::UpdateContext;
@ -24,7 +24,7 @@ impl<'a> VariableDumper<'a> {
pub fn dump<'gc>(
value: &Value<'gc>,
indent: &str,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> String {
let mut dumper = VariableDumper::new(indent);
@ -85,7 +85,7 @@ impl<'a> VariableDumper<'a> {
pub fn print_object<'gc>(
&mut self,
object: &Object<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) {
let (id, new) = self.object_id(object);
@ -102,7 +102,7 @@ impl<'a> VariableDumper<'a> {
&mut self,
object: &Object<'gc>,
key: &str,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) {
match object.get(&key, activation, context) {
@ -120,7 +120,7 @@ impl<'a> VariableDumper<'a> {
pub fn print_properties<'gc>(
&mut self,
object: &Object<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) {
let keys = object.get_keys(activation);
@ -147,7 +147,7 @@ impl<'a> VariableDumper<'a> {
pub fn print_value<'gc>(
&mut self,
value: &Value<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) {
match value {
@ -169,7 +169,7 @@ impl<'a> VariableDumper<'a> {
header: &str,
name: &str,
object: &Object<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) {
let keys = object.get_keys(activation);
@ -203,7 +203,7 @@ mod tests {
use enumset::EnumSet;
fn throw_error<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],

View File

@ -1,7 +1,7 @@
//! FSCommand handling
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::UpdateContext;
/// Parse an FSCommand URL.
pub fn parse(url: &str) -> Option<&str> {
@ -16,7 +16,7 @@ pub fn parse(url: &str) -> Option<&str> {
/// TODO: FSCommand URL handling
pub fn handle<'gc>(
fscommand: &str,
_activation: &mut StackFrame,
_activation: &mut Activation,
_ac: &mut UpdateContext,
) -> Result<(), Error<'gc>> {
log::warn!("Unhandled FSCommand: {}", fscommand);

View File

@ -1,9 +1,9 @@
//! Code relating to executable functions + calling conventions.
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::property::{Attribute, Attribute::*};
use crate::avm1::scope::Scope;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::super_object::SuperObject;
use crate::avm1::value::Value;
use crate::avm1::{Object, ObjectPtr, ScriptObject, TObject, UpdateContext};
@ -30,7 +30,7 @@ use swf::avm1::types::FunctionParam;
/// your function yields `None`, you must ensure that the top-most activation
/// in the AVM1 runtime will return with the value of this function.
pub type NativeFunction<'gc> = fn(
&mut StackFrame<'_, 'gc>,
&mut Activation<'_, 'gc>,
&mut UpdateContext<'_, 'gc, '_>,
Object<'gc>,
&[Value<'gc>],
@ -222,7 +222,7 @@ impl<'gc> Executable<'gc> {
/// create a new stack frame and execute the action data yourself.
pub fn exec(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
ac: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
base_proto: Option<Object<'gc>>,
@ -278,7 +278,7 @@ impl<'gc> Executable<'gc> {
.unwrap_or(ac.player_version)
};
let mut frame = StackFrame::from_action(
let mut frame = Activation::from_action(
activation.avm(),
effective_ver,
child_scope,
@ -452,7 +452,7 @@ impl<'gc> TObject<'gc> for FunctionObject<'gc> {
fn get_local(
&self,
name: &str,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
) -> Result<Value<'gc>, Error<'gc>> {
@ -463,7 +463,7 @@ impl<'gc> TObject<'gc> for FunctionObject<'gc> {
&self,
name: &str,
value: Value<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<(), Error<'gc>> {
self.base.set(name, value, activation, context)
@ -471,7 +471,7 @@ impl<'gc> TObject<'gc> for FunctionObject<'gc> {
fn call(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
base_proto: Option<Object<'gc>>,
@ -488,7 +488,7 @@ impl<'gc> TObject<'gc> for FunctionObject<'gc> {
&self,
name: &str,
value: Value<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Option<Executable<'gc>> {
self.base.call_setter(name, value, activation, context)
@ -497,7 +497,7 @@ impl<'gc> TObject<'gc> for FunctionObject<'gc> {
#[allow(clippy::new_ret_no_self)]
fn new(
&self,
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
prototype: Object<'gc>,
_args: &[Value<'gc>],
@ -519,7 +519,7 @@ impl<'gc> TObject<'gc> for FunctionObject<'gc> {
fn delete(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
gc_context: MutationContext<'gc, '_>,
name: &str,
) -> bool {
@ -569,7 +569,7 @@ impl<'gc> TObject<'gc> for FunctionObject<'gc> {
fn add_property_with_case(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
gc_context: MutationContext<'gc, '_>,
name: &str,
get: Executable<'gc>,
@ -582,7 +582,7 @@ impl<'gc> TObject<'gc> for FunctionObject<'gc> {
fn has_property(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
name: &str,
) -> bool {
@ -591,7 +591,7 @@ impl<'gc> TObject<'gc> for FunctionObject<'gc> {
fn has_own_property(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
name: &str,
) -> bool {
@ -600,22 +600,22 @@ impl<'gc> TObject<'gc> for FunctionObject<'gc> {
fn has_own_virtual(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
name: &str,
) -> bool {
self.base.has_own_virtual(activation, context, name)
}
fn is_property_overwritable(&self, activation: &mut StackFrame<'_, 'gc>, name: &str) -> bool {
fn is_property_overwritable(&self, activation: &mut Activation<'_, 'gc>, name: &str) -> bool {
self.base.is_property_overwritable(activation, name)
}
fn is_property_enumerable(&self, activation: &mut StackFrame<'_, 'gc>, name: &str) -> bool {
fn is_property_enumerable(&self, activation: &mut Activation<'_, 'gc>, name: &str) -> bool {
self.base.is_property_enumerable(activation, name)
}
fn get_keys(&self, activation: &mut StackFrame<'_, 'gc>) -> Vec<String> {
fn get_keys(&self, activation: &mut Activation<'_, 'gc>) -> Vec<String> {
self.base.get_keys(activation)
}

View File

@ -1,8 +1,8 @@
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::fscommand;
use crate::avm1::function::{Executable, FunctionObject};
use crate::avm1::listeners::SystemListeners;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{Object, ScriptObject, TObject, UpdateContext, Value};
use crate::backend::navigator::NavigationMethod;
use enumset::EnumSet;
@ -40,7 +40,7 @@ mod xml;
#[allow(non_snake_case, unused_must_use)] //can't use errors yet
pub fn getURL<'a, 'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'a, 'gc, '_>,
_this: Object<'gc>,
args: &[Value<'gc>],
@ -74,7 +74,7 @@ pub fn getURL<'a, 'gc>(
}
pub fn random<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
action_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
args: &[Value<'gc>],
@ -86,7 +86,7 @@ pub fn random<'gc>(
}
pub fn is_nan<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
action_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
args: &[Value<'gc>],
@ -102,7 +102,7 @@ pub fn is_nan<'gc>(
}
pub fn get_infinity<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
_action_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -115,7 +115,7 @@ pub fn get_infinity<'gc>(
}
pub fn get_nan<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
_action_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -477,7 +477,7 @@ mod tests {
use super::*;
fn setup<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Object<'gc> {
create_globals(context.gc_context).1

View File

@ -1,9 +1,9 @@
//! Array class
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::function::{Executable, FunctionObject};
use crate::avm1::property::Attribute;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{Object, ScriptObject, TObject, UpdateContext, Value};
use enumset::EnumSet;
use gc_arena::MutationContext;
@ -26,7 +26,7 @@ const DEFAULT_ORDERING: Ordering = Ordering::Equal;
type CompareFn<'a, 'gc> = Box<
dyn 'a
+ FnMut(
&mut StackFrame<'_, 'gc>,
&mut Activation<'_, 'gc>,
&mut UpdateContext<'_, 'gc, '_>,
&Value<'gc>,
&Value<'gc>,
@ -89,7 +89,7 @@ pub fn create_array_object<'gc>(
/// Implements `Array`
pub fn constructor<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -124,7 +124,7 @@ pub fn constructor<'gc>(
}
pub fn push<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -145,7 +145,7 @@ pub fn push<'gc>(
}
pub fn unshift<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -170,7 +170,7 @@ pub fn unshift<'gc>(
}
pub fn shift<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -197,7 +197,7 @@ pub fn shift<'gc>(
}
pub fn pop<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -219,7 +219,7 @@ pub fn pop<'gc>(
}
pub fn reverse<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -235,7 +235,7 @@ pub fn reverse<'gc>(
}
pub fn join<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -269,7 +269,7 @@ fn make_index_absolute(mut index: i32, length: usize) -> usize {
}
pub fn slice<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -300,7 +300,7 @@ pub fn slice<'gc>(
}
pub fn splice<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -372,7 +372,7 @@ pub fn splice<'gc>(
}
pub fn concat<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -432,7 +432,7 @@ pub fn concat<'gc>(
}
pub fn to_string<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -441,7 +441,7 @@ pub fn to_string<'gc>(
}
fn sort<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -487,7 +487,7 @@ fn sort<'gc>(
}
fn sort_on<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -570,11 +570,11 @@ fn sort_on<'gc>(
}
fn sort_with_function<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
mut compare_fn: impl FnMut(
&mut StackFrame<'_, 'gc>,
&mut Activation<'_, 'gc>,
&mut UpdateContext<'_, 'gc, '_>,
&Value<'gc>,
&Value<'gc>,
@ -718,7 +718,7 @@ pub fn create_proto<'gc>(
}
fn sort_compare_string<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
a: &Value<'gc>,
b: &Value<'gc>,
@ -734,7 +734,7 @@ fn sort_compare_string<'gc>(
}
fn sort_compare_string_ignore_case<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
a: &Value<'gc>,
b: &Value<'gc>,
@ -751,13 +751,13 @@ fn sort_compare_string_ignore_case<'gc>(
fn sort_compare_numeric<'gc>(
mut string_compare_fn: impl FnMut(
&mut StackFrame<'_, 'gc>,
&mut Activation<'_, 'gc>,
&mut UpdateContext<'_, 'gc, '_>,
&Value<'gc>,
&Value<'gc>,
) -> Ordering,
) -> impl FnMut(
&mut StackFrame<'_, 'gc>,
&mut Activation<'_, 'gc>,
&mut UpdateContext<'_, 'gc, '_>,
&Value<'gc>,
&Value<'gc>,
@ -776,7 +776,7 @@ fn sort_compare_fields<'a, 'gc: 'a>(
mut compare_fns: Vec<CompareFn<'a, 'gc>>,
) -> impl 'a
+ FnMut(
&mut StackFrame<'_, 'gc>,
&mut Activation<'_, 'gc>,
&mut UpdateContext<'_, 'gc, '_>,
&Value<'gc>,
&Value<'gc>,
@ -801,7 +801,7 @@ fn sort_compare_fields<'a, 'gc: 'a>(
// Returning an impl Trait here doesn't work yet because of https://github.com/rust-lang/rust/issues/65805 (?)
fn sort_compare_custom<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
a: &Value<'gc>,

View File

@ -1,8 +1,8 @@
//! `Boolean` class impl
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::function::{Executable, FunctionObject};
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::value_object::ValueObject;
use crate::avm1::{Object, TObject, Value};
use crate::context::UpdateContext;
@ -11,7 +11,7 @@ use gc_arena::MutationContext;
/// `Boolean` constructor/function
pub fn boolean<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -74,7 +74,7 @@ pub fn create_proto<'gc>(
}
pub fn to_string<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -91,7 +91,7 @@ pub fn to_string<'gc>(
}
pub fn value_of<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],

View File

@ -1,8 +1,8 @@
//! Button/SimpleButton prototype
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::globals::display_object;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{Object, ScriptObject, UpdateContext, Value};
use gc_arena::MutationContext;
@ -20,7 +20,7 @@ pub fn create_proto<'gc>(
/// Implements `Button` constructor.
pub fn constructor<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_action_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],

View File

@ -3,16 +3,16 @@
//! TODO: This should change when `ColorTransform` changes to match Flash's representation
//! (See GitHub #193)
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::property::Attribute::*;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{Object, ScriptObject, TObject, UpdateContext, Value};
use crate::display_object::{DisplayObject, TDisplayObject};
use enumset::EnumSet;
use gc_arena::MutationContext;
pub fn constructor<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
mut this: Object<'gc>,
args: &[Value<'gc>],
@ -75,7 +75,7 @@ pub fn create_proto<'gc>(
/// Gets the target display object of this color transform.
fn target<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
) -> Result<Option<DisplayObject<'gc>>, Error<'gc>> {
@ -93,7 +93,7 @@ fn target<'gc>(
}
fn get_rgb<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -110,7 +110,7 @@ fn get_rgb<'gc>(
}
fn get_transform<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -174,7 +174,7 @@ fn get_transform<'gc>(
}
fn set_rgb<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -200,7 +200,7 @@ fn set_rgb<'gc>(
}
fn set_transform<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -209,7 +209,7 @@ fn set_transform<'gc>(
// to the 16-bit range used by the internal representations of the Flash Player.
// This will get slightly simpler when we change ColorTransform to the proper representation (see #193).
fn set_color_mult<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
transform: Object<'gc>,
property: &str,
@ -226,7 +226,7 @@ fn set_transform<'gc>(
}
fn set_color_add<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
transform: Object<'gc>,
property: &str,

View File

@ -1,9 +1,9 @@
//! DisplayObject common methods
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::function::Executable;
use crate::avm1::property::Attribute::*;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{Object, ScriptObject, TObject, UpdateContext, Value};
use crate::display_object::{DisplayObject, TDisplayObject};
use enumset::EnumSet;
@ -79,7 +79,7 @@ pub fn define_display_object_proto<'gc>(
}
pub fn get_parent<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -94,7 +94,7 @@ pub fn get_parent<'gc>(
pub fn get_depth<'gc>(
display_object: DisplayObject<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -107,7 +107,7 @@ pub fn get_depth<'gc>(
}
pub fn overwrite_root<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
ac: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -122,7 +122,7 @@ pub fn overwrite_root<'gc>(
}
pub fn overwrite_global<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
ac: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],

View File

@ -1,14 +1,14 @@
//! Function prototype
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{Object, ScriptObject, TObject, UpdateContext, Value};
use enumset::EnumSet;
use gc_arena::MutationContext;
/// Implements `Function`
pub fn constructor<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_action_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -18,7 +18,7 @@ pub fn constructor<'gc>(
/// Implements `Function.prototype.call`
pub fn call<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
action_context: &mut UpdateContext<'_, 'gc, '_>,
func: Object<'gc>,
myargs: &[Value<'gc>],
@ -42,7 +42,7 @@ pub fn call<'gc>(
/// Implements `Function.prototype.apply`
pub fn apply<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
action_context: &mut UpdateContext<'_, 'gc, '_>,
func: Object<'gc>,
myargs: &[Value<'gc>],
@ -75,7 +75,7 @@ pub fn apply<'gc>(
/// Implements `Function.prototype.toString`
fn to_string<'gc>(
_: &mut StackFrame<'_, 'gc>,
_: &mut Activation<'_, 'gc>,
_: &mut UpdateContext<'_, 'gc, '_>,
_: Object<'gc>,
_: &[Value<'gc>],

View File

@ -1,13 +1,13 @@
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::property::Attribute;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{Object, ScriptObject, TObject, UpdateContext, Value};
use crate::events::KeyCode;
use gc_arena::MutationContext;
use std::convert::TryFrom;
pub fn is_down<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
args: &[Value<'gc>],
@ -24,7 +24,7 @@ pub fn is_down<'gc>(
}
pub fn get_code<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],

View File

@ -1,7 +1,7 @@
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::object::Object;
use crate::avm1::property::Attribute::*;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{ScriptObject, TObject, UpdateContext, Value};
use gc_arena::MutationContext;
use rand::Rng;
@ -28,7 +28,7 @@ macro_rules! wrap_std {
}
fn atan2<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
args: &[Value<'gc>],
@ -47,7 +47,7 @@ fn atan2<'gc>(
}
fn pow<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
args: &[Value<'gc>],
@ -65,7 +65,7 @@ fn pow<'gc>(
}
fn round<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
args: &[Value<'gc>],
@ -81,7 +81,7 @@ fn round<'gc>(
}
fn max<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
args: &[Value<'gc>],
@ -106,7 +106,7 @@ fn max<'gc>(
}
fn min<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
args: &[Value<'gc>],
@ -131,7 +131,7 @@ fn min<'gc>(
}
pub fn random<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
action_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -262,7 +262,7 @@ mod tests {
use crate::avm1::test_utils::with_avm;
fn setup<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Object<'gc> {
create(

View File

@ -1,8 +1,8 @@
//! flash.geom.Matrix
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::function::{Executable, FunctionObject};
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{Object, ScriptObject, TObject, Value};
use crate::context::UpdateContext;
use enumset::EnumSet;
@ -11,7 +11,7 @@ use swf::{Matrix, Twips};
pub fn value_to_matrix<'gc>(
value: Value<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<Matrix, Error<'gc>> {
let a = value
@ -48,7 +48,7 @@ pub fn value_to_matrix<'gc>(
pub fn gradient_object_to_matrix<'gc>(
object: Object<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<Matrix, Error<'gc>> {
if object
@ -86,7 +86,7 @@ pub fn gradient_object_to_matrix<'gc>(
pub fn object_to_matrix<'gc>(
object: Object<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<Matrix, Error<'gc>> {
let a = object
@ -119,7 +119,7 @@ pub fn object_to_matrix<'gc>(
#[allow(dead_code)]
pub fn matrix_to_object<'gc>(
matrix: Matrix,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<Object<'gc>, Error<'gc>> {
let proto = context.system_prototypes.matrix;
@ -139,7 +139,7 @@ pub fn matrix_to_object<'gc>(
pub fn apply_matrix_to_object<'gc>(
matrix: Matrix,
object: Object<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<(), Error<'gc>> {
object.set("a", matrix.a.into(), activation, context)?;
@ -152,7 +152,7 @@ pub fn apply_matrix_to_object<'gc>(
}
fn constructor<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -184,7 +184,7 @@ fn constructor<'gc>(
}
fn identity<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -194,7 +194,7 @@ fn identity<'gc>(
}
fn clone<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -214,7 +214,7 @@ fn clone<'gc>(
}
fn scale<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -235,7 +235,7 @@ fn scale<'gc>(
}
fn rotate<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -252,7 +252,7 @@ fn rotate<'gc>(
}
fn translate<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -276,7 +276,7 @@ fn translate<'gc>(
}
fn concat<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -294,7 +294,7 @@ fn concat<'gc>(
}
fn invert<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -307,7 +307,7 @@ fn invert<'gc>(
}
fn create_box<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -349,7 +349,7 @@ fn create_box<'gc>(
}
fn create_gradient_box<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -391,7 +391,7 @@ fn create_gradient_box<'gc>(
}
fn to_string<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],

View File

@ -1,12 +1,12 @@
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::listeners::Listeners;
use crate::avm1::property::Attribute;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{Object, ScriptObject, TObject, UpdateContext, Value};
use gc_arena::MutationContext;
pub fn show_mouse<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -21,7 +21,7 @@ pub fn show_mouse<'gc>(
}
pub fn hide_mouse<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],

View File

@ -1,10 +1,10 @@
//! MovieClip prototype
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::globals::display_object::{self, AVM_DEPTH_BIAS, AVM_MAX_DEPTH};
use crate::avm1::globals::matrix::gradient_object_to_matrix;
use crate::avm1::property::Attribute::*;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{Object, ScriptObject, TObject, UpdateContext, Value};
use crate::backend::navigator::NavigationMethod;
use crate::display_object::{DisplayObject, EditText, MovieClip, TDisplayObject};
@ -19,7 +19,7 @@ use swf::{
/// Implements `MovieClip`
pub fn constructor<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_action_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -51,7 +51,7 @@ macro_rules! with_movie_clip {
#[allow(clippy::comparison_chain)]
pub fn hit_test<'gc>(
movie_clip: MovieClip<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -144,7 +144,7 @@ pub fn create_proto<'gc>(
fn line_style<'gc>(
movie_clip: MovieClip<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -236,7 +236,7 @@ fn line_style<'gc>(
fn begin_fill<'gc>(
movie_clip: MovieClip<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -264,7 +264,7 @@ fn begin_fill<'gc>(
fn begin_gradient_fill<'gc>(
movie_clip: MovieClip<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -353,7 +353,7 @@ fn begin_gradient_fill<'gc>(
fn move_to<'gc>(
movie_clip: MovieClip<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -373,7 +373,7 @@ fn move_to<'gc>(
fn line_to<'gc>(
movie_clip: MovieClip<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -393,7 +393,7 @@ fn line_to<'gc>(
fn curve_to<'gc>(
movie_clip: MovieClip<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -419,7 +419,7 @@ fn curve_to<'gc>(
fn end_fill<'gc>(
movie_clip: MovieClip<'gc>,
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -429,7 +429,7 @@ fn end_fill<'gc>(
fn clear<'gc>(
movie_clip: MovieClip<'gc>,
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -439,7 +439,7 @@ fn clear<'gc>(
fn attach_movie<'gc>(
mut movie_clip: MovieClip<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -493,7 +493,7 @@ fn attach_movie<'gc>(
fn create_empty_movie_clip<'gc>(
mut movie_clip: MovieClip<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -528,7 +528,7 @@ fn create_empty_movie_clip<'gc>(
fn create_text_field<'gc>(
mut movie_clip: MovieClip<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -583,7 +583,7 @@ fn create_text_field<'gc>(
fn duplicate_movie_clip<'gc>(
movie_clip: MovieClip<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -593,7 +593,7 @@ fn duplicate_movie_clip<'gc>(
pub fn duplicate_movie_clip_with_bias<'gc>(
movie_clip: MovieClip<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
args: &[Value<'gc>],
depth_bias: i32,
@ -657,7 +657,7 @@ pub fn duplicate_movie_clip_with_bias<'gc>(
fn get_bytes_loaded<'gc>(
_movie_clip: MovieClip<'gc>,
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -667,7 +667,7 @@ fn get_bytes_loaded<'gc>(
fn get_bytes_total<'gc>(
_movie_clip: MovieClip<'gc>,
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -677,7 +677,7 @@ fn get_bytes_total<'gc>(
fn get_next_highest_depth<'gc>(
movie_clip: MovieClip<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -697,7 +697,7 @@ fn get_next_highest_depth<'gc>(
fn goto_and_play<'gc>(
movie_clip: MovieClip<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -706,7 +706,7 @@ fn goto_and_play<'gc>(
fn goto_and_stop<'gc>(
movie_clip: MovieClip<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -715,7 +715,7 @@ fn goto_and_stop<'gc>(
pub fn goto_frame<'gc>(
movie_clip: MovieClip<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
args: &[Value<'gc>],
stop: bool,
@ -757,7 +757,7 @@ pub fn goto_frame<'gc>(
fn next_frame<'gc>(
movie_clip: MovieClip<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -767,7 +767,7 @@ fn next_frame<'gc>(
fn play<'gc>(
movie_clip: MovieClip<'gc>,
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -777,7 +777,7 @@ fn play<'gc>(
fn prev_frame<'gc>(
movie_clip: MovieClip<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -787,7 +787,7 @@ fn prev_frame<'gc>(
fn remove_movie_clip<'gc>(
movie_clip: MovieClip<'gc>,
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -820,7 +820,7 @@ pub fn remove_movie_clip_with_bias<'gc>(
fn start_drag<'gc>(
movie_clip: MovieClip<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -830,7 +830,7 @@ fn start_drag<'gc>(
fn stop<'gc>(
movie_clip: MovieClip<'gc>,
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -840,7 +840,7 @@ fn stop<'gc>(
fn stop_drag<'gc>(
_movie_clip: MovieClip<'gc>,
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -851,7 +851,7 @@ fn stop_drag<'gc>(
fn swap_depths<'gc>(
movie_clip: MovieClip<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -896,7 +896,7 @@ fn swap_depths<'gc>(
fn to_string<'gc>(
movie_clip: MovieClip<'gc>,
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -905,7 +905,7 @@ fn to_string<'gc>(
fn local_to_global<'gc>(
movie_clip: MovieClip<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -933,7 +933,7 @@ fn local_to_global<'gc>(
fn get_bounds<'gc>(
movie_clip: MovieClip<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -997,7 +997,7 @@ fn get_bounds<'gc>(
fn get_rect<'gc>(
movie_clip: MovieClip<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -1008,7 +1008,7 @@ fn get_rect<'gc>(
fn global_to_local<'gc>(
movie_clip: MovieClip<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -1036,7 +1036,7 @@ fn global_to_local<'gc>(
fn load_movie<'gc>(
target: MovieClip<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -1060,7 +1060,7 @@ fn load_movie<'gc>(
fn load_variables<'gc>(
target: MovieClip<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -1083,7 +1083,7 @@ fn load_variables<'gc>(
fn unload_movie<'gc>(
mut target: MovieClip<'gc>,
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {

View File

@ -1,10 +1,10 @@
//! `MovieClipLoader` impl
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::object::TObject;
use crate::avm1::property::Attribute;
use crate::avm1::script_object::ScriptObject;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{Object, UpdateContext, Value};
use crate::backend::navigator::RequestOptions;
use crate::display_object::{DisplayObject, TDisplayObject};
@ -12,7 +12,7 @@ use enumset::EnumSet;
use gc_arena::MutationContext;
pub fn constructor<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -33,7 +33,7 @@ pub fn constructor<'gc>(
}
pub fn add_listener<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -51,7 +51,7 @@ pub fn add_listener<'gc>(
}
pub fn remove_listener<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -94,7 +94,7 @@ pub fn remove_listener<'gc>(
}
pub fn broadcast_message<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -118,7 +118,7 @@ pub fn broadcast_message<'gc>(
}
pub fn load_clip<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -150,7 +150,7 @@ pub fn load_clip<'gc>(
}
pub fn unload_clip<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
args: &[Value<'gc>],
@ -173,7 +173,7 @@ pub fn unload_clip<'gc>(
}
pub fn get_progress<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
args: &[Value<'gc>],

View File

@ -1,9 +1,9 @@
//! `Number` class impl
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::function::{Executable, FunctionObject};
use crate::avm1::property::Attribute::*;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::value_object::ValueObject;
use crate::avm1::{Object, TObject, Value};
use crate::context::UpdateContext;
@ -12,7 +12,7 @@ use gc_arena::MutationContext;
/// `Number` constructor/function
pub fn number<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -113,7 +113,7 @@ pub fn create_proto<'gc>(
}
fn to_string<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -186,7 +186,7 @@ fn to_string<'gc>(
}
fn value_of<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],

View File

@ -1,8 +1,8 @@
//! Object prototype
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::function::{Executable, FunctionObject};
use crate::avm1::property::Attribute::{self, *};
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{Object, TObject, UpdateContext, Value};
use crate::character::Character;
use enumset::EnumSet;
@ -11,7 +11,7 @@ use std::borrow::Cow;
/// Implements `Object`
pub fn constructor<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_action_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -21,7 +21,7 @@ pub fn constructor<'gc>(
/// Implements `Object.prototype.addProperty`
pub fn add_property<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -71,7 +71,7 @@ pub fn add_property<'gc>(
/// Implements `Object.prototype.hasOwnProperty`
pub fn has_own_property<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -88,7 +88,7 @@ pub fn has_own_property<'gc>(
/// Implements `Object.prototype.toString`
fn to_string<'gc>(
_: &mut StackFrame<'_, 'gc>,
_: &mut Activation<'_, 'gc>,
_: &mut UpdateContext<'_, 'gc, '_>,
_: Object<'gc>,
_: &[Value<'gc>],
@ -98,7 +98,7 @@ fn to_string<'gc>(
/// Implements `Object.prototype.isPropertyEnumerable`
fn is_property_enumerable<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
_: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -111,7 +111,7 @@ fn is_property_enumerable<'gc>(
/// Implements `Object.prototype.isPrototypeOf`
fn is_prototype_of<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -127,7 +127,7 @@ fn is_prototype_of<'gc>(
/// Implements `Object.prototype.valueOf`
fn value_of<'gc>(
_: &mut StackFrame<'_, 'gc>,
_: &mut Activation<'_, 'gc>,
_: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_: &[Value<'gc>],
@ -137,7 +137,7 @@ fn value_of<'gc>(
/// Implements `Object.registerClass`
pub fn register_class<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
args: &[Value<'gc>],
@ -226,7 +226,7 @@ pub fn fill_proto<'gc>(
/// declare the property flags of a given property. It's not part of
/// `Object.prototype`, and I suspect that's a deliberate omission.
pub fn as_set_prop_flags<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
ac: &mut UpdateContext<'_, 'gc, '_>,
_: Object<'gc>,
args: &[Value<'gc>],

View File

@ -1,9 +1,9 @@
//! flash.geom.Point
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::function::{Executable, FunctionObject};
use crate::avm1::property::Attribute;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{Object, ScriptObject, TObject, Value};
use crate::context::UpdateContext;
use enumset::EnumSet;
@ -12,7 +12,7 @@ use std::f64::NAN;
pub fn point_to_object<'gc>(
point: (f64, f64),
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<Object<'gc>, Error<'gc>> {
let args = [point.0.into(), point.1.into()];
@ -21,7 +21,7 @@ pub fn point_to_object<'gc>(
pub fn construct_new_point<'gc>(
args: &[Value<'gc>],
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<Object<'gc>, Error<'gc>> {
let proto = context.system_prototypes.point;
@ -32,7 +32,7 @@ pub fn construct_new_point<'gc>(
pub fn value_to_point<'gc>(
value: Value<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<(f64, f64), Error<'gc>> {
let x = value
@ -48,7 +48,7 @@ pub fn value_to_point<'gc>(
pub fn object_to_point<'gc>(
object: Object<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<(f64, f64), Error<'gc>> {
let x = object
@ -61,7 +61,7 @@ pub fn object_to_point<'gc>(
}
fn constructor<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -88,7 +88,7 @@ fn constructor<'gc>(
}
fn clone<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -105,7 +105,7 @@ fn clone<'gc>(
}
fn equals<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -123,7 +123,7 @@ fn equals<'gc>(
}
fn add<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -144,7 +144,7 @@ fn add<'gc>(
}
fn subtract<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -165,7 +165,7 @@ fn subtract<'gc>(
}
fn distance<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
args: &[Value<'gc>],
@ -186,7 +186,7 @@ fn distance<'gc>(
}
fn polar<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
args: &[Value<'gc>],
@ -208,7 +208,7 @@ fn polar<'gc>(
}
fn interpolate<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
args: &[Value<'gc>],
@ -225,7 +225,7 @@ fn interpolate<'gc>(
}
fn to_string<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -242,7 +242,7 @@ fn to_string<'gc>(
}
fn length<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -253,7 +253,7 @@ fn length<'gc>(
}
fn normalize<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -284,7 +284,7 @@ fn normalize<'gc>(
}
fn offset<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],

View File

@ -1,10 +1,10 @@
//! flash.geom.Rectangle
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::function::{Executable, FunctionObject};
use crate::avm1::globals::point::{construct_new_point, point_to_object, value_to_point};
use crate::avm1::property::Attribute;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{Object, ScriptObject, TObject, Value};
use crate::context::UpdateContext;
use enumset::EnumSet;
@ -12,7 +12,7 @@ use gc_arena::MutationContext;
use std::f64::NAN;
fn constructor<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -53,7 +53,7 @@ fn constructor<'gc>(
}
fn to_string<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -87,7 +87,7 @@ pub fn create_rectangle_object<'gc>(
}
fn is_empty<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -102,7 +102,7 @@ fn is_empty<'gc>(
}
fn set_empty<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -115,7 +115,7 @@ fn set_empty<'gc>(
}
fn clone<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -133,7 +133,7 @@ fn clone<'gc>(
}
fn contains<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -173,7 +173,7 @@ fn contains<'gc>(
}
fn contains_point<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -206,7 +206,7 @@ fn contains_point<'gc>(
}
fn contains_rectangle<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -259,7 +259,7 @@ fn contains_rectangle<'gc>(
}
fn intersects<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -308,7 +308,7 @@ fn intersects<'gc>(
}
fn union<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -392,7 +392,7 @@ fn union<'gc>(
}
fn inflate<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -439,7 +439,7 @@ fn inflate<'gc>(
}
fn inflate_point<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -481,7 +481,7 @@ fn inflate_point<'gc>(
}
fn offset<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -510,7 +510,7 @@ fn offset<'gc>(
}
fn offset_point<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -534,7 +534,7 @@ fn offset_point<'gc>(
}
fn intersection<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -615,7 +615,7 @@ fn intersection<'gc>(
}
fn equals<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -643,7 +643,7 @@ fn equals<'gc>(
}
fn get_left<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -652,7 +652,7 @@ fn get_left<'gc>(
}
fn set_left<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -675,7 +675,7 @@ fn set_left<'gc>(
}
fn get_top<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -684,7 +684,7 @@ fn get_top<'gc>(
}
fn set_top<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -707,7 +707,7 @@ fn set_top<'gc>(
}
fn get_right<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -722,7 +722,7 @@ fn get_right<'gc>(
}
fn set_right<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -742,7 +742,7 @@ fn set_right<'gc>(
}
fn get_bottom<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -757,7 +757,7 @@ fn get_bottom<'gc>(
}
fn set_bottom<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -777,7 +777,7 @@ fn set_bottom<'gc>(
}
fn get_size<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -789,7 +789,7 @@ fn get_size<'gc>(
}
fn set_size<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -810,7 +810,7 @@ fn set_size<'gc>(
}
fn get_top_left<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -822,7 +822,7 @@ fn get_top_left<'gc>(
}
fn set_top_left<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -867,7 +867,7 @@ fn set_top_left<'gc>(
}
fn get_bottom_right<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -889,7 +889,7 @@ fn get_bottom_right<'gc>(
}
fn set_bottom_right<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],

View File

@ -1,6 +1,6 @@
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::function::{Executable, FunctionObject};
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{Object, TObject, Value};
use crate::context::UpdateContext;
use enumset::EnumSet;
@ -11,7 +11,7 @@ use crate::avm1::shared_object::SharedObject;
use json::JsonValue;
pub fn delete_all<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_action_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -21,7 +21,7 @@ pub fn delete_all<'gc>(
}
pub fn get_disk_usage<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_action_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -34,7 +34,7 @@ pub fn get_disk_usage<'gc>(
/// It would be best if this was implemented via serde but due to avm and context it can't
/// Undefined fields aren't serialized
fn recursive_serialize<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
action_context: &mut UpdateContext<'_, 'gc, '_>,
obj: Object<'gc>,
json_obj: &mut JsonValue,
@ -69,7 +69,7 @@ fn recursive_serialize<'gc>(
/// Undefined fields aren't deserialized
fn recursive_deserialize<'gc>(
json_obj: JsonValue,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
object: Object<'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) {
@ -132,7 +132,7 @@ fn recursive_deserialize<'gc>(
}
pub fn get_local<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
action_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
args: &[Value<'gc>],
@ -187,7 +187,7 @@ pub fn get_local<'gc>(
}
pub fn get_remote<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_action_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -197,7 +197,7 @@ pub fn get_remote<'gc>(
}
pub fn get_max_size<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_action_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -207,7 +207,7 @@ pub fn get_max_size<'gc>(
}
pub fn add_listener<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_action_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -217,7 +217,7 @@ pub fn add_listener<'gc>(
}
pub fn remove_listener<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_action_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -299,7 +299,7 @@ pub fn create_shared_object_object<'gc>(
}
pub fn clear<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
action_context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -321,7 +321,7 @@ pub fn clear<'gc>(
}
pub fn close<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_action_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -331,7 +331,7 @@ pub fn close<'gc>(
}
pub fn connect<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_action_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -341,7 +341,7 @@ pub fn connect<'gc>(
}
pub fn flush<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
action_context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -363,7 +363,7 @@ pub fn flush<'gc>(
}
pub fn get_size<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_action_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -373,7 +373,7 @@ pub fn get_size<'gc>(
}
pub fn send<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_action_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -383,7 +383,7 @@ pub fn send<'gc>(
}
pub fn set_fps<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_action_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -393,7 +393,7 @@ pub fn set_fps<'gc>(
}
pub fn on_status<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_action_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -403,7 +403,7 @@ pub fn on_status<'gc>(
}
pub fn on_sync<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_action_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -472,7 +472,7 @@ pub fn create_proto<'gc>(
}
pub fn constructor<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],

View File

@ -1,10 +1,10 @@
//! AVM1 Sound object
//! TODO: Sound position, transform, loadSound
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::function::Executable;
use crate::avm1::property::Attribute::*;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{Object, SoundObject, TObject, UpdateContext, Value};
use crate::character::Character;
use crate::display_object::TDisplayObject;
@ -12,7 +12,7 @@ use gc_arena::MutationContext;
/// Implements `Sound`
pub fn constructor<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -161,7 +161,7 @@ pub fn create_proto<'gc>(
}
fn attach_sound<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -201,7 +201,7 @@ fn attach_sound<'gc>(
}
fn duration<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -218,7 +218,7 @@ fn duration<'gc>(
}
fn get_bytes_loaded<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -232,7 +232,7 @@ fn get_bytes_loaded<'gc>(
}
fn get_bytes_total<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -246,7 +246,7 @@ fn get_bytes_total<'gc>(
}
fn get_pan<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -256,7 +256,7 @@ fn get_pan<'gc>(
}
fn get_transform<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -266,7 +266,7 @@ fn get_transform<'gc>(
}
fn get_volume<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -276,7 +276,7 @@ fn get_volume<'gc>(
}
fn id3<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -288,7 +288,7 @@ fn id3<'gc>(
}
fn load_sound<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -300,7 +300,7 @@ fn load_sound<'gc>(
}
fn position<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -324,7 +324,7 @@ fn position<'gc>(
}
fn set_pan<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -334,7 +334,7 @@ fn set_pan<'gc>(
}
fn set_transform<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -344,7 +344,7 @@ fn set_transform<'gc>(
}
fn set_volume<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -354,7 +354,7 @@ fn set_volume<'gc>(
}
fn start<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -405,7 +405,7 @@ fn start<'gc>(
}
fn stop<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],

View File

@ -1,10 +1,10 @@
//! Stage object
//!
//! TODO: This is a very rough stub with not much implementation.
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::function::Executable;
use crate::avm1::property::Attribute;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{Object, ScriptObject, TObject, UpdateContext, Value};
use gc_arena::MutationContext;
@ -76,7 +76,7 @@ pub fn create_stage_object<'gc>(
}
fn add_listener<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -86,7 +86,7 @@ fn add_listener<'gc>(
}
fn align<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -96,7 +96,7 @@ fn align<'gc>(
}
fn set_align<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -106,7 +106,7 @@ fn set_align<'gc>(
}
fn height<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -115,7 +115,7 @@ fn height<'gc>(
}
fn remove_listener<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -125,7 +125,7 @@ fn remove_listener<'gc>(
}
fn scale_mode<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -135,7 +135,7 @@ fn scale_mode<'gc>(
}
fn set_scale_mode<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -145,7 +145,7 @@ fn set_scale_mode<'gc>(
}
fn show_menu<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -155,7 +155,7 @@ fn show_menu<'gc>(
}
fn set_show_menu<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -165,7 +165,7 @@ fn set_show_menu<'gc>(
}
fn width<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],

View File

@ -1,9 +1,9 @@
//! `String` class impl
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::function::{Executable, FunctionObject};
use crate::avm1::property::Attribute::*;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::value_object::ValueObject;
use crate::avm1::{Object, ScriptObject, TObject, Value};
use crate::context::UpdateContext;
@ -13,7 +13,7 @@ use gc_arena::MutationContext;
/// `String` constructor
pub fn string<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
ac: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -171,7 +171,7 @@ pub fn create_proto<'gc>(
}
fn char_at<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -197,7 +197,7 @@ fn char_at<'gc>(
}
fn char_code_at<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -220,7 +220,7 @@ fn char_code_at<'gc>(
}
fn concat<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -236,7 +236,7 @@ fn concat<'gc>(
}
fn from_char_code<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
args: &[Value<'gc>],
@ -255,7 +255,7 @@ fn from_char_code<'gc>(
}
fn index_of<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -303,7 +303,7 @@ fn index_of<'gc>(
}
fn last_index_of<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -355,7 +355,7 @@ fn last_index_of<'gc>(
}
fn slice<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -391,7 +391,7 @@ fn slice<'gc>(
}
fn split<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -421,7 +421,7 @@ fn split<'gc>(
}
fn substr<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -448,7 +448,7 @@ fn substr<'gc>(
}
fn substring<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -483,7 +483,7 @@ fn substring<'gc>(
}
fn to_lower_case<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -499,7 +499,7 @@ fn to_lower_case<'gc>(
/// `String.toString` / `String.valueOf` impl
pub fn to_string_value_of<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -517,7 +517,7 @@ pub fn to_string_value_of<'gc>(
}
fn to_upper_case<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],

View File

@ -1,7 +1,7 @@
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::function::Executable;
use crate::avm1::object::Object;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{ScriptObject, TObject, Value};
use crate::context::UpdateContext;
use core::fmt;
@ -273,7 +273,7 @@ pub struct SystemProperties {
}
impl SystemProperties {
pub fn get_version_string(&self, activation: &mut StackFrame) -> String {
pub fn get_version_string(&self, activation: &mut Activation) -> String {
format!(
"{} {},0,0,0",
self.manufacturer.get_platform_name(),
@ -305,7 +305,7 @@ impl SystemProperties {
percent_encoding::utf8_percent_encode(s, percent_encoding::NON_ALPHANUMERIC).to_string()
}
pub fn get_server_string(&self, activation: &mut StackFrame) -> String {
pub fn get_server_string(&self, activation: &mut Activation) -> String {
url::form_urlencoded::Serializer::new(String::new())
.append_pair("A", self.encode_capability(SystemCapabilities::Audio))
.append_pair(
@ -403,7 +403,7 @@ impl Default for SystemProperties {
}
pub fn set_clipboard<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
action_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
args: &[Value<'gc>],
@ -420,7 +420,7 @@ pub fn set_clipboard<'gc>(
}
pub fn show_settings<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
action_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
args: &[Value<'gc>],
@ -440,7 +440,7 @@ pub fn show_settings<'gc>(
}
pub fn set_use_code_page<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
action_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
args: &[Value<'gc>],
@ -457,7 +457,7 @@ pub fn set_use_code_page<'gc>(
}
pub fn get_use_code_page<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
action_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -466,7 +466,7 @@ pub fn get_use_code_page<'gc>(
}
pub fn set_exact_settings<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
action_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
args: &[Value<'gc>],
@ -483,7 +483,7 @@ pub fn set_exact_settings<'gc>(
}
pub fn get_exact_settings<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
action_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -492,7 +492,7 @@ pub fn get_exact_settings<'gc>(
}
pub fn on_status<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_action_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],

View File

@ -1,8 +1,8 @@
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::function::Executable;
use crate::avm1::globals::system::SystemCapabilities;
use crate::avm1::object::Object;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{ScriptObject, TObject, Value};
use crate::context::UpdateContext;
use enumset::EnumSet;
@ -11,7 +11,7 @@ use gc_arena::MutationContext;
macro_rules! capabilities_func {
($func_name: ident, $capability: expr) => {
pub fn $func_name<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -24,7 +24,7 @@ macro_rules! capabilities_func {
macro_rules! inverse_capabilities_func {
($func_name: ident, $capability: expr) => {
pub fn $func_name<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -77,7 +77,7 @@ inverse_capabilities_func!(get_is_av_hardware_disabled, SystemCapabilities::AvHa
inverse_capabilities_func!(get_is_windowless_disabled, SystemCapabilities::WindowLess);
pub fn get_player_type<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -86,7 +86,7 @@ pub fn get_player_type<'gc>(
}
pub fn get_screen_color<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -95,7 +95,7 @@ pub fn get_screen_color<'gc>(
}
pub fn get_language<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -108,7 +108,7 @@ pub fn get_language<'gc>(
}
pub fn get_screen_resolution_x<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -117,7 +117,7 @@ pub fn get_screen_resolution_x<'gc>(
}
pub fn get_screen_resolution_y<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -126,7 +126,7 @@ pub fn get_screen_resolution_y<'gc>(
}
pub fn get_pixel_aspect_ratio<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -135,7 +135,7 @@ pub fn get_pixel_aspect_ratio<'gc>(
}
pub fn get_screen_dpi<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -144,7 +144,7 @@ pub fn get_screen_dpi<'gc>(
}
pub fn get_manufacturer<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -157,7 +157,7 @@ pub fn get_manufacturer<'gc>(
}
pub fn get_os_name<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -166,7 +166,7 @@ pub fn get_os_name<'gc>(
}
pub fn get_version<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -175,7 +175,7 @@ pub fn get_version<'gc>(
}
pub fn get_server_string<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -184,7 +184,7 @@ pub fn get_server_string<'gc>(
}
pub fn get_cpu_architecture<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -193,7 +193,7 @@ pub fn get_cpu_architecture<'gc>(
}
pub fn get_max_idc_level<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],

View File

@ -1,16 +1,16 @@
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::listeners::Listeners;
use crate::avm1::object::Object;
use crate::avm1::property::Attribute;
use crate::avm1::property::Attribute::{DontDelete, DontEnum, ReadOnly};
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{ScriptObject, TObject, Value};
use crate::context::UpdateContext;
use gc_arena::MutationContext;
use std::convert::Into;
fn on_ime_composition<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -19,7 +19,7 @@ fn on_ime_composition<'gc>(
}
fn do_conversion<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -28,7 +28,7 @@ fn do_conversion<'gc>(
}
fn get_conversion_mode<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -37,7 +37,7 @@ fn get_conversion_mode<'gc>(
}
fn get_enabled<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -46,7 +46,7 @@ fn get_enabled<'gc>(
}
fn set_composition_string<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -55,7 +55,7 @@ fn set_composition_string<'gc>(
}
fn set_conversion_mode<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -64,7 +64,7 @@ fn set_conversion_mode<'gc>(
}
fn set_enabled<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],

View File

@ -1,7 +1,7 @@
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::function::Executable;
use crate::avm1::object::Object;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{ScriptObject, TObject, Value};
use crate::context::UpdateContext;
use enumset::EnumSet;
@ -9,7 +9,7 @@ use gc_arena::MutationContext;
use std::convert::Into;
fn allow_domain<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -19,7 +19,7 @@ fn allow_domain<'gc>(
}
fn allow_insecure_domain<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -29,7 +29,7 @@ fn allow_insecure_domain<'gc>(
}
fn load_policy_file<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -39,7 +39,7 @@ fn load_policy_file<'gc>(
}
fn escape_domain<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -49,7 +49,7 @@ fn escape_domain<'gc>(
}
fn get_sandbox_type<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -58,7 +58,7 @@ fn get_sandbox_type<'gc>(
}
fn get_choose_local_swf_path<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -68,7 +68,7 @@ fn get_choose_local_swf_path<'gc>(
}
fn policy_file_resolver<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],

View File

@ -1,8 +1,8 @@
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::function::Executable;
use crate::avm1::globals::display_object;
use crate::avm1::property::Attribute::*;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{Object, ScriptObject, TObject, UpdateContext, Value};
use crate::display_object::{AutoSizeMode, EditText, TDisplayObject};
use crate::html::TextFormat;
@ -10,7 +10,7 @@ use gc_arena::MutationContext;
/// Implements `TextField`
pub fn constructor<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -19,7 +19,7 @@ pub fn constructor<'gc>(
}
pub fn get_text<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -33,7 +33,7 @@ pub fn get_text<'gc>(
}
pub fn set_text<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -55,7 +55,7 @@ pub fn set_text<'gc>(
}
pub fn get_html<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -69,7 +69,7 @@ pub fn get_html<'gc>(
}
pub fn set_html<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -85,7 +85,7 @@ pub fn set_html<'gc>(
}
pub fn get_html_text<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -101,7 +101,7 @@ pub fn get_html_text<'gc>(
}
pub fn set_html_text<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -120,7 +120,7 @@ pub fn set_html_text<'gc>(
}
pub fn get_border<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -135,7 +135,7 @@ pub fn get_border<'gc>(
}
pub fn set_border<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -152,7 +152,7 @@ pub fn set_border<'gc>(
}
pub fn get_embed_fonts<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -167,7 +167,7 @@ pub fn get_embed_fonts<'gc>(
}
pub fn set_embed_fonts<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -184,7 +184,7 @@ pub fn set_embed_fonts<'gc>(
}
pub fn get_length<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -219,7 +219,7 @@ macro_rules! with_text_field {
}
pub fn text_width<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -237,7 +237,7 @@ pub fn text_width<'gc>(
}
pub fn text_height<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -255,7 +255,7 @@ pub fn text_height<'gc>(
}
pub fn multiline<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -271,7 +271,7 @@ pub fn multiline<'gc>(
}
pub fn set_multiline<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -293,7 +293,7 @@ pub fn set_multiline<'gc>(
}
fn variable<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -312,7 +312,7 @@ fn variable<'gc>(
}
fn set_variable<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -333,7 +333,7 @@ fn set_variable<'gc>(
}
pub fn word_wrap<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -349,7 +349,7 @@ pub fn word_wrap<'gc>(
}
pub fn set_word_wrap<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -371,7 +371,7 @@ pub fn set_word_wrap<'gc>(
}
pub fn auto_size<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -392,7 +392,7 @@ pub fn auto_size<'gc>(
}
pub fn set_auto_size<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -528,7 +528,7 @@ pub fn attach_virtual_properties<'gc>(gc_context: MutationContext<'gc, '_>, obje
fn get_new_text_format<'gc>(
text_field: EditText<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -539,7 +539,7 @@ fn get_new_text_format<'gc>(
fn set_new_text_format<'gc>(
text_field: EditText<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -555,7 +555,7 @@ fn set_new_text_format<'gc>(
fn get_text_format<'gc>(
text_field: EditText<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -579,7 +579,7 @@ fn get_text_format<'gc>(
fn set_text_format<'gc>(
text_field: EditText<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -608,7 +608,7 @@ fn set_text_format<'gc>(
fn replace_text<'gc>(
text_field: EditText<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {

View File

@ -1,14 +1,14 @@
//! `TextFormat` impl
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{Object, ScriptObject, TObject, UpdateContext, Value};
use gc_arena::MutationContext;
fn map_defined_to_string<'gc>(
name: &str,
this: Object<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
ac: &mut UpdateContext<'_, 'gc, '_>,
val: Option<Value<'gc>>,
) -> Result<(), Error<'gc>> {
@ -27,7 +27,7 @@ fn map_defined_to_string<'gc>(
fn map_defined_to_number<'gc>(
name: &str,
this: Object<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
ac: &mut UpdateContext<'_, 'gc, '_>,
val: Option<Value<'gc>>,
) -> Result<(), Error<'gc>> {
@ -46,7 +46,7 @@ fn map_defined_to_number<'gc>(
fn map_defined_to_bool<'gc>(
name: &str,
this: Object<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
ac: &mut UpdateContext<'_, 'gc, '_>,
val: Option<Value<'gc>>,
) -> Result<(), Error<'gc>> {
@ -64,7 +64,7 @@ fn map_defined_to_bool<'gc>(
/// `TextFormat` constructor
pub fn constructor<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
ac: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],

View File

@ -1,10 +1,10 @@
//! XML/XMLNode global classes
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::function::Executable;
use crate::avm1::property::Attribute::*;
use crate::avm1::script_object::ScriptObject;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::xml_object::XMLObject;
use crate::avm1::{Object, TObject, UpdateContext, Value};
use crate::backend::navigator::RequestOptions;
@ -42,7 +42,7 @@ fn is_as2_compatible(node: XMLNode<'_>) -> bool {
/// XMLNode constructor
pub fn xmlnode_constructor<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
ac: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -73,7 +73,7 @@ pub fn xmlnode_constructor<'gc>(
}
pub fn xmlnode_append_child<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
ac: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -95,7 +95,7 @@ pub fn xmlnode_append_child<'gc>(
}
pub fn xmlnode_insert_before<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
ac: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -123,7 +123,7 @@ pub fn xmlnode_insert_before<'gc>(
}
pub fn xmlnode_clone_node<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
ac: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -146,7 +146,7 @@ pub fn xmlnode_clone_node<'gc>(
}
pub fn xmlnode_get_namespace_for_prefix<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
ac: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -166,7 +166,7 @@ pub fn xmlnode_get_namespace_for_prefix<'gc>(
}
pub fn xmlnode_get_prefix_for_namespace<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
ac: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -186,7 +186,7 @@ pub fn xmlnode_get_prefix_for_namespace<'gc>(
}
pub fn xmlnode_has_child_nodes<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_ac: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -199,7 +199,7 @@ pub fn xmlnode_has_child_nodes<'gc>(
}
pub fn xmlnode_remove_node<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
ac: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -216,7 +216,7 @@ pub fn xmlnode_remove_node<'gc>(
}
pub fn xmlnode_to_string<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_ac: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -236,7 +236,7 @@ pub fn xmlnode_to_string<'gc>(
}
pub fn xmlnode_local_name<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_ac: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -249,7 +249,7 @@ pub fn xmlnode_local_name<'gc>(
}
pub fn xmlnode_node_name<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_ac: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -262,7 +262,7 @@ pub fn xmlnode_node_name<'gc>(
}
pub fn xmlnode_node_type<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_ac: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -282,7 +282,7 @@ pub fn xmlnode_node_type<'gc>(
}
pub fn xmlnode_node_value<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_ac: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -295,7 +295,7 @@ pub fn xmlnode_node_value<'gc>(
}
pub fn xmlnode_prefix<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_ac: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -312,7 +312,7 @@ pub fn xmlnode_prefix<'gc>(
}
pub fn xmlnode_child_nodes<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
ac: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -345,7 +345,7 @@ pub fn xmlnode_child_nodes<'gc>(
}
pub fn xmlnode_first_child<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
ac: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -367,7 +367,7 @@ pub fn xmlnode_first_child<'gc>(
}
pub fn xmlnode_last_child<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
ac: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -389,7 +389,7 @@ pub fn xmlnode_last_child<'gc>(
}
pub fn xmlnode_parent_node<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
ac: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -410,7 +410,7 @@ pub fn xmlnode_parent_node<'gc>(
}
pub fn xmlnode_previous_sibling<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
ac: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -437,7 +437,7 @@ pub fn xmlnode_previous_sibling<'gc>(
}
pub fn xmlnode_next_sibling<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
ac: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -464,7 +464,7 @@ pub fn xmlnode_next_sibling<'gc>(
}
pub fn xmlnode_attributes<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
ac: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -480,7 +480,7 @@ pub fn xmlnode_attributes<'gc>(
}
pub fn xmlnode_namespace_uri<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_ac: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -684,7 +684,7 @@ pub fn create_xmlnode_proto<'gc>(
/// XML (document) constructor
pub fn xml_constructor<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
ac: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -717,7 +717,7 @@ pub fn xml_constructor<'gc>(
}
pub fn xml_create_element<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
ac: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -745,7 +745,7 @@ pub fn xml_create_element<'gc>(
}
pub fn xml_create_text_node<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
ac: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -773,7 +773,7 @@ pub fn xml_create_text_node<'gc>(
}
pub fn xml_parse_xml<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
ac: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -806,7 +806,7 @@ pub fn xml_parse_xml<'gc>(
}
pub fn xml_load<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
ac: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -840,7 +840,7 @@ pub fn xml_load<'gc>(
}
pub fn xml_on_data<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
ac: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -862,7 +862,7 @@ pub fn xml_on_data<'gc>(
}
pub fn xml_doc_type_decl<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_ac: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -884,7 +884,7 @@ pub fn xml_doc_type_decl<'gc>(
}
pub fn xml_xml_decl<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_ac: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -903,7 +903,7 @@ pub fn xml_xml_decl<'gc>(
}
pub fn xml_id_map<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
ac: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -916,7 +916,7 @@ pub fn xml_id_map<'gc>(
}
pub fn xml_status<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_ac: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],

View File

@ -1,5 +1,5 @@
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{Object, ScriptObject, TObject, UpdateContext, Value};
use gc_arena::{Collect, MutationContext};
@ -10,7 +10,7 @@ pub struct Listeners<'gc>(Object<'gc>);
macro_rules! register_listener {
( $gc_context: ident, $object:ident, $listener: ident, $fn_proto: ident, $system_listeners_key: ident ) => {{
pub fn add_listener<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
args: &[Value<'gc>],
@ -23,7 +23,7 @@ macro_rules! register_listener {
}
pub fn remove_listener<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
args: &[Value<'gc>],
@ -81,7 +81,7 @@ impl<'gc> Listeners<'gc> {
pub fn remove_listener(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
@ -112,7 +112,7 @@ impl<'gc> Listeners<'gc> {
pub fn prepare_handlers(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
method: &str,
) -> Vec<(Object<'gc>, Value<'gc>)> {

View File

@ -7,7 +7,7 @@ use crate::avm1::shared_object::SharedObject;
use crate::avm1::super_object::SuperObject;
use crate::avm1::value_object::ValueObject;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::activation::Activation;
use crate::avm1::xml_attributes_object::XMLAttributesObject;
use crate::avm1::xml_idmap_object::XMLIDMapObject;
use crate::avm1::xml_object::XMLObject;
@ -50,7 +50,7 @@ pub trait TObject<'gc>: 'gc + Collect + Debug + Into<Object<'gc>> + Clone + Copy
fn get_local(
&self,
name: &str,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
) -> Result<Value<'gc>, Error<'gc>>;
@ -59,7 +59,7 @@ pub trait TObject<'gc>: 'gc + Collect + Debug + Into<Object<'gc>> + Clone + Copy
fn get(
&self,
name: &str,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<Value<'gc>, Error<'gc>> {
if self.has_own_property(activation, context, name) {
@ -74,7 +74,7 @@ pub trait TObject<'gc>: 'gc + Collect + Debug + Into<Object<'gc>> + Clone + Copy
&self,
name: &str,
value: Value<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<(), Error<'gc>>;
@ -85,7 +85,7 @@ pub trait TObject<'gc>: 'gc + Collect + Debug + Into<Object<'gc>> + Clone + Copy
/// it can be changed by `Function.apply`/`Function.call`.
fn call(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
base_proto: Option<Object<'gc>>,
@ -103,7 +103,7 @@ pub trait TObject<'gc>: 'gc + Collect + Debug + Into<Object<'gc>> + Clone + Copy
&self,
name: &str,
args: &[Value<'gc>],
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<Value<'gc>, Error<'gc>> {
let (method, base_proto) = search_prototype(
@ -136,7 +136,7 @@ pub trait TObject<'gc>: 'gc + Collect + Debug + Into<Object<'gc>> + Clone + Copy
&self,
name: &str,
value: Value<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Option<Executable<'gc>>;
@ -153,7 +153,7 @@ pub trait TObject<'gc>: 'gc + Collect + Debug + Into<Object<'gc>> + Clone + Copy
/// purely so that host objects can be constructed by the VM.
fn new(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -164,7 +164,7 @@ pub trait TObject<'gc>: 'gc + Collect + Debug + Into<Object<'gc>> + Clone + Copy
/// Returns false if the property cannot be deleted.
fn delete(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
gc_context: MutationContext<'gc, '_>,
name: &str,
) -> bool;
@ -248,7 +248,7 @@ pub trait TObject<'gc>: 'gc + Collect + Debug + Into<Object<'gc>> + Clone + Copy
/// as `__proto__`.
fn add_property_with_case(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
gc_context: MutationContext<'gc, '_>,
name: &str,
get: Executable<'gc>,
@ -259,7 +259,7 @@ pub trait TObject<'gc>: 'gc + Collect + Debug + Into<Object<'gc>> + Clone + Copy
/// Checks if the object has a given named property.
fn has_property(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
name: &str,
) -> bool;
@ -268,7 +268,7 @@ pub trait TObject<'gc>: 'gc + Collect + Debug + Into<Object<'gc>> + Clone + Copy
/// say, the object's prototype or superclass)
fn has_own_property(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
name: &str,
) -> bool;
@ -277,19 +277,19 @@ pub trait TObject<'gc>: 'gc + Collect + Debug + Into<Object<'gc>> + Clone + Copy
/// virtual.
fn has_own_virtual(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
name: &str,
) -> bool;
/// Checks if a named property can be overwritten.
fn is_property_overwritable(&self, activation: &mut StackFrame<'_, 'gc>, name: &str) -> bool;
fn is_property_overwritable(&self, activation: &mut Activation<'_, 'gc>, name: &str) -> bool;
/// Checks if a named property appears when enumerating the object.
fn is_property_enumerable(&self, activation: &mut StackFrame<'_, 'gc>, name: &str) -> bool;
fn is_property_enumerable(&self, activation: &mut Activation<'_, 'gc>, name: &str) -> bool;
/// Enumerate the object.
fn get_keys(&self, activation: &mut StackFrame<'_, 'gc>) -> Vec<String>;
fn get_keys(&self, activation: &mut Activation<'_, 'gc>) -> Vec<String>;
/// Coerce the object into a string.
fn as_string(&self) -> Cow<str>;
@ -320,7 +320,7 @@ pub trait TObject<'gc>: 'gc + Collect + Debug + Into<Object<'gc>> + Clone + Copy
/// somehow could this would support that, too.
fn is_instance_of(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
constructor: Object<'gc>,
prototype: Object<'gc>,
@ -470,7 +470,7 @@ impl<'gc> Object<'gc> {
pub fn search_prototype<'gc>(
mut proto: Option<Object<'gc>>,
name: &str,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
) -> Result<(Value<'gc>, Option<Object<'gc>>), Error<'gc>> {

View File

@ -1,7 +1,7 @@
//! Represents AVM1 scope chain resolution.
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{Object, ScriptObject, TObject, UpdateContext, Value};
use enumset::EnumSet;
use gc_arena::{GcCell, MutationContext};
@ -239,7 +239,7 @@ impl<'gc> Scope<'gc> {
pub fn resolve(
&self,
name: &str,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
) -> Result<Value<'gc>, Error<'gc>> {
@ -257,7 +257,7 @@ impl<'gc> Scope<'gc> {
/// Check if a particular property in the scope chain is defined.
pub fn is_defined(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
name: &str,
) -> bool {
@ -282,7 +282,7 @@ impl<'gc> Scope<'gc> {
&self,
name: &str,
value: Value<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
) -> Result<(), Error<'gc>> {
@ -319,7 +319,7 @@ impl<'gc> Scope<'gc> {
/// Delete a value from scope
pub fn delete(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
name: &str,
mc: MutationContext<'gc, '_>,

View File

@ -1,7 +1,7 @@
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::function::{Executable, FunctionObject, NativeFunction};
use crate::avm1::property::{Attribute, Property};
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{Object, ObjectPtr, TObject, UpdateContext, Value};
use crate::property_map::{Entry, PropertyMap};
use core::fmt;
@ -197,7 +197,7 @@ impl<'gc> ScriptObject<'gc> {
&self,
name: &str,
value: Value<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
base_proto: Option<Object<'gc>>,
@ -301,7 +301,7 @@ impl<'gc> TObject<'gc> for ScriptObject<'gc> {
fn get_local(
&self,
name: &str,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
) -> Result<Value<'gc>, Error<'gc>> {
@ -339,7 +339,7 @@ impl<'gc> TObject<'gc> for ScriptObject<'gc> {
&self,
name: &str,
value: Value<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<(), Error<'gc>> {
self.internal_set(
@ -359,7 +359,7 @@ impl<'gc> TObject<'gc> for ScriptObject<'gc> {
/// overrides that may need to interact with the underlying object.
fn call(
&self,
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_base_proto: Option<Object<'gc>>,
@ -372,7 +372,7 @@ impl<'gc> TObject<'gc> for ScriptObject<'gc> {
&self,
name: &str,
value: Value<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Option<Executable<'gc>> {
match self
@ -389,7 +389,7 @@ impl<'gc> TObject<'gc> for ScriptObject<'gc> {
#[allow(clippy::new_ret_no_self)]
fn new(
&self,
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -409,7 +409,7 @@ impl<'gc> TObject<'gc> for ScriptObject<'gc> {
/// Returns false if the property cannot be deleted.
fn delete(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
gc_context: MutationContext<'gc, '_>,
name: &str,
) -> bool {
@ -445,7 +445,7 @@ impl<'gc> TObject<'gc> for ScriptObject<'gc> {
fn add_property_with_case(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
gc_context: MutationContext<'gc, '_>,
name: &str,
get: Executable<'gc>,
@ -512,7 +512,7 @@ impl<'gc> TObject<'gc> for ScriptObject<'gc> {
/// Checks if the object has a given named property.
fn has_property(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
name: &str,
) -> bool {
@ -527,7 +527,7 @@ impl<'gc> TObject<'gc> for ScriptObject<'gc> {
/// say, the object's prototype or superclass)
fn has_own_property(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
name: &str,
) -> bool {
@ -542,7 +542,7 @@ impl<'gc> TObject<'gc> for ScriptObject<'gc> {
fn has_own_virtual(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
name: &str,
) -> bool {
@ -558,7 +558,7 @@ impl<'gc> TObject<'gc> for ScriptObject<'gc> {
}
}
fn is_property_overwritable(&self, activation: &mut StackFrame<'_, 'gc>, name: &str) -> bool {
fn is_property_overwritable(&self, activation: &mut Activation<'_, 'gc>, name: &str) -> bool {
self.0
.read()
.values
@ -568,7 +568,7 @@ impl<'gc> TObject<'gc> for ScriptObject<'gc> {
}
/// Checks if a named property appears when enumerating the object.
fn is_property_enumerable(&self, activation: &mut StackFrame<'_, 'gc>, name: &str) -> bool {
fn is_property_enumerable(&self, activation: &mut Activation<'_, 'gc>, name: &str) -> bool {
if let Some(prop) = self
.0
.read()
@ -582,7 +582,7 @@ impl<'gc> TObject<'gc> for ScriptObject<'gc> {
}
/// Enumerate the object.
fn get_keys(&self, activation: &mut StackFrame<'_, 'gc>) -> Vec<String> {
fn get_keys(&self, activation: &mut Activation<'_, 'gc>) -> Vec<String> {
let proto_keys = self
.proto()
.map_or_else(Vec::new, |p| p.get_keys(activation));
@ -756,7 +756,7 @@ mod tests {
fn with_object<F, R>(swf_version: u8, test: F) -> R
where
F: for<'a, 'gc> FnOnce(
&mut StackFrame<'_, 'gc>,
&mut Activation<'_, 'gc>,
&mut UpdateContext<'a, 'gc, '_>,
Object<'gc>,
) -> R,
@ -809,7 +809,7 @@ mod tests {
let object = ScriptObject::object(gc_context, Some(avm.prototypes().object)).into();
let globals = avm.global_object_cell();
let mut activation = StackFrame::from_nothing(
let mut activation = Activation::from_nothing(
&mut avm,
context.swf.version(),
globals,

View File

@ -1,8 +1,8 @@
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::function::Executable;
use crate::avm1::property::Attribute;
use crate::avm1::sound_object::SoundObject;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{Object, ObjectPtr, ScriptObject, TObject, Value};
use crate::context::UpdateContext;
use crate::display_object::DisplayObject;
@ -73,7 +73,7 @@ impl<'gc> TObject<'gc> for SharedObject<'gc> {
fn get_local(
&self,
name: &str,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
) -> Result<Value<'gc>, Error<'gc>> {
@ -84,7 +84,7 @@ impl<'gc> TObject<'gc> for SharedObject<'gc> {
&self,
name: &str,
value: Value<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<(), Error<'gc>> {
self.base().set(name, value, activation, context)
@ -92,7 +92,7 @@ impl<'gc> TObject<'gc> for SharedObject<'gc> {
fn call(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
base_proto: Option<Object<'gc>>,
@ -106,7 +106,7 @@ impl<'gc> TObject<'gc> for SharedObject<'gc> {
&self,
name: &str,
value: Value<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Option<Executable<'gc>> {
self.base().call_setter(name, value, activation, context)
@ -115,7 +115,7 @@ impl<'gc> TObject<'gc> for SharedObject<'gc> {
#[allow(clippy::new_ret_no_self)]
fn new(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -129,7 +129,7 @@ impl<'gc> TObject<'gc> for SharedObject<'gc> {
fn delete(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
gc_context: MutationContext<'gc, '_>,
name: &str,
) -> bool {
@ -180,7 +180,7 @@ impl<'gc> TObject<'gc> for SharedObject<'gc> {
fn add_property_with_case(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
gc_context: MutationContext<'gc, '_>,
name: &str,
get: Executable<'gc>,
@ -193,7 +193,7 @@ impl<'gc> TObject<'gc> for SharedObject<'gc> {
fn has_property(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
name: &str,
) -> bool {
@ -202,7 +202,7 @@ impl<'gc> TObject<'gc> for SharedObject<'gc> {
fn has_own_property(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
name: &str,
) -> bool {
@ -211,22 +211,22 @@ impl<'gc> TObject<'gc> for SharedObject<'gc> {
fn has_own_virtual(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
name: &str,
) -> bool {
self.base().has_own_virtual(activation, context, name)
}
fn is_property_overwritable(&self, activation: &mut StackFrame<'_, 'gc>, name: &str) -> bool {
fn is_property_overwritable(&self, activation: &mut Activation<'_, 'gc>, name: &str) -> bool {
self.base().is_property_overwritable(activation, name)
}
fn is_property_enumerable(&self, activation: &mut StackFrame<'_, 'gc>, name: &str) -> bool {
fn is_property_enumerable(&self, activation: &mut Activation<'_, 'gc>, name: &str) -> bool {
self.base().is_property_enumerable(activation, name)
}
fn get_keys(&self, activation: &mut StackFrame<'_, 'gc>) -> Vec<String> {
fn get_keys(&self, activation: &mut Activation<'_, 'gc>) -> Vec<String> {
self.base().get_keys(activation)
}

View File

@ -1,9 +1,9 @@
//! AVM1 object type to represent Sound objects.
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::function::Executable;
use crate::avm1::property::Attribute;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{Object, ObjectPtr, ScriptObject, TObject, Value};
use crate::backend::audio::{SoundHandle, SoundInstanceHandle};
use crate::context::UpdateContext;
@ -134,7 +134,7 @@ impl<'gc> TObject<'gc> for SoundObject<'gc> {
fn get_local(
&self,
name: &str,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
) -> Result<Value<'gc>, Error<'gc>> {
@ -145,7 +145,7 @@ impl<'gc> TObject<'gc> for SoundObject<'gc> {
&self,
name: &str,
value: Value<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<(), Error<'gc>> {
self.base().set(name, value, activation, context)
@ -153,7 +153,7 @@ impl<'gc> TObject<'gc> for SoundObject<'gc> {
fn call(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
base_proto: Option<Object<'gc>>,
@ -167,7 +167,7 @@ impl<'gc> TObject<'gc> for SoundObject<'gc> {
&self,
name: &str,
value: Value<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Option<Executable<'gc>> {
self.base().call_setter(name, value, activation, context)
@ -176,7 +176,7 @@ impl<'gc> TObject<'gc> for SoundObject<'gc> {
#[allow(clippy::new_ret_no_self)]
fn new(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -189,7 +189,7 @@ impl<'gc> TObject<'gc> for SoundObject<'gc> {
fn delete(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
gc_context: MutationContext<'gc, '_>,
name: &str,
) -> bool {
@ -240,7 +240,7 @@ impl<'gc> TObject<'gc> for SoundObject<'gc> {
fn add_property_with_case(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
gc_context: MutationContext<'gc, '_>,
name: &str,
get: Executable<'gc>,
@ -253,7 +253,7 @@ impl<'gc> TObject<'gc> for SoundObject<'gc> {
fn has_property(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
name: &str,
) -> bool {
@ -262,7 +262,7 @@ impl<'gc> TObject<'gc> for SoundObject<'gc> {
fn has_own_property(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
name: &str,
) -> bool {
@ -271,22 +271,22 @@ impl<'gc> TObject<'gc> for SoundObject<'gc> {
fn has_own_virtual(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
name: &str,
) -> bool {
self.base().has_own_virtual(activation, context, name)
}
fn is_property_overwritable(&self, activation: &mut StackFrame<'_, 'gc>, name: &str) -> bool {
fn is_property_overwritable(&self, activation: &mut Activation<'_, 'gc>, name: &str) -> bool {
self.base().is_property_overwritable(activation, name)
}
fn is_property_enumerable(&self, activation: &mut StackFrame<'_, 'gc>, name: &str) -> bool {
fn is_property_enumerable(&self, activation: &mut Activation<'_, 'gc>, name: &str) -> bool {
self.base().is_property_enumerable(activation, name)
}
fn get_keys(&self, activation: &mut StackFrame<'_, 'gc>) -> Vec<String> {
fn get_keys(&self, activation: &mut Activation<'_, 'gc>) -> Vec<String> {
self.base().get_keys(activation)
}

View File

@ -1,10 +1,10 @@
//! AVM1 object type to represent objects on the stage.
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::function::Executable;
use crate::avm1::object::search_prototype;
use crate::avm1::property::Attribute;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{Object, ObjectPtr, ScriptObject, TDisplayObject, TObject, Value};
use crate::context::UpdateContext;
use crate::display_object::{DisplayObject, EditText, MovieClip};
@ -127,7 +127,7 @@ impl<'gc> TObject<'gc> for StageObject<'gc> {
fn get(
&self,
name: &str,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<Value<'gc>, Error<'gc>> {
let obj = self.0.read();
@ -160,7 +160,7 @@ impl<'gc> TObject<'gc> for StageObject<'gc> {
fn get_local(
&self,
name: &str,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
) -> Result<Value<'gc>, Error<'gc>> {
@ -174,7 +174,7 @@ impl<'gc> TObject<'gc> for StageObject<'gc> {
&self,
name: &str,
value: Value<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<(), Error<'gc>> {
let obj = self.0.read();
@ -221,7 +221,7 @@ impl<'gc> TObject<'gc> for StageObject<'gc> {
fn call(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
base_proto: Option<Object<'gc>>,
@ -237,7 +237,7 @@ impl<'gc> TObject<'gc> for StageObject<'gc> {
&self,
name: &str,
value: Value<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Option<Executable<'gc>> {
self.0
@ -249,7 +249,7 @@ impl<'gc> TObject<'gc> for StageObject<'gc> {
#[allow(clippy::new_ret_no_self)]
fn new(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -260,7 +260,7 @@ impl<'gc> TObject<'gc> for StageObject<'gc> {
fn delete(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
gc_context: MutationContext<'gc, '_>,
name: &str,
) -> bool {
@ -319,7 +319,7 @@ impl<'gc> TObject<'gc> for StageObject<'gc> {
fn add_property_with_case(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
gc_context: MutationContext<'gc, '_>,
name: &str,
get: Executable<'gc>,
@ -334,7 +334,7 @@ impl<'gc> TObject<'gc> for StageObject<'gc> {
fn has_property(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
name: &str,
) -> bool {
@ -365,7 +365,7 @@ impl<'gc> TObject<'gc> for StageObject<'gc> {
fn has_own_property(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
name: &str,
) -> bool {
@ -378,7 +378,7 @@ impl<'gc> TObject<'gc> for StageObject<'gc> {
fn has_own_virtual(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
name: &str,
) -> bool {
@ -388,18 +388,18 @@ impl<'gc> TObject<'gc> for StageObject<'gc> {
.has_own_virtual(activation, context, name)
}
fn is_property_enumerable(&self, activation: &mut StackFrame<'_, 'gc>, name: &str) -> bool {
fn is_property_enumerable(&self, activation: &mut Activation<'_, 'gc>, name: &str) -> bool {
self.0.read().base.is_property_enumerable(activation, name)
}
fn is_property_overwritable(&self, activation: &mut StackFrame<'_, 'gc>, name: &str) -> bool {
fn is_property_overwritable(&self, activation: &mut Activation<'_, 'gc>, name: &str) -> bool {
self.0
.read()
.base
.is_property_overwritable(activation, name)
}
fn get_keys(&self, activation: &mut StackFrame<'_, 'gc>) -> Vec<String> {
fn get_keys(&self, activation: &mut Activation<'_, 'gc>) -> Vec<String> {
// Keys from the underlying object are listed first, followed by
// child display objects in order from highest depth to lowest depth.
let obj = self.0.read();
@ -496,13 +496,13 @@ pub struct DisplayProperty<'gc> {
}
pub type DisplayGetter<'gc> = fn(
&mut StackFrame<'_, 'gc>,
&mut Activation<'_, 'gc>,
&mut UpdateContext<'_, 'gc, '_>,
DisplayObject<'gc>,
) -> Result<Value<'gc>, Error<'gc>>;
pub type DisplaySetter<'gc> = fn(
&mut StackFrame<'_, 'gc>,
&mut Activation<'_, 'gc>,
&mut UpdateContext<'_, 'gc, '_>,
DisplayObject<'gc>,
Value<'gc>,
@ -511,7 +511,7 @@ pub type DisplaySetter<'gc> = fn(
impl<'gc> DisplayProperty<'gc> {
pub fn get(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: DisplayObject<'gc>,
) -> Result<Value<'gc>, Error<'gc>> {
@ -520,7 +520,7 @@ impl<'gc> DisplayProperty<'gc> {
pub fn set(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: DisplayObject<'gc>,
value: Value<'gc>,
@ -603,7 +603,7 @@ impl<'gc> DisplayPropertyMap<'gc> {
}
fn x<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
this: DisplayObject<'gc>,
) -> Result<Value<'gc>, Error<'gc>> {
@ -611,7 +611,7 @@ fn x<'gc>(
}
fn set_x<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
mut this: DisplayObject<'gc>,
val: Value<'gc>,
@ -623,7 +623,7 @@ fn set_x<'gc>(
}
fn y<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
this: DisplayObject<'gc>,
) -> Result<Value<'gc>, Error<'gc>> {
@ -631,7 +631,7 @@ fn y<'gc>(
}
fn set_y<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
mut this: DisplayObject<'gc>,
val: Value<'gc>,
@ -643,7 +643,7 @@ fn set_y<'gc>(
}
fn x_scale<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
mut this: DisplayObject<'gc>,
) -> Result<Value<'gc>, Error<'gc>> {
@ -652,7 +652,7 @@ fn x_scale<'gc>(
}
fn set_x_scale<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
mut this: DisplayObject<'gc>,
val: Value<'gc>,
@ -664,7 +664,7 @@ fn set_x_scale<'gc>(
}
fn y_scale<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
mut this: DisplayObject<'gc>,
) -> Result<Value<'gc>, Error<'gc>> {
@ -673,7 +673,7 @@ fn y_scale<'gc>(
}
fn set_y_scale<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
mut this: DisplayObject<'gc>,
val: Value<'gc>,
@ -685,7 +685,7 @@ fn set_y_scale<'gc>(
}
fn current_frame<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
this: DisplayObject<'gc>,
) -> Result<Value<'gc>, Error<'gc>> {
@ -697,7 +697,7 @@ fn current_frame<'gc>(
}
fn total_frames<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
this: DisplayObject<'gc>,
) -> Result<Value<'gc>, Error<'gc>> {
@ -709,7 +709,7 @@ fn total_frames<'gc>(
}
fn alpha<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
this: DisplayObject<'gc>,
) -> Result<Value<'gc>, Error<'gc>> {
@ -718,7 +718,7 @@ fn alpha<'gc>(
}
fn set_alpha<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: DisplayObject<'gc>,
val: Value<'gc>,
@ -730,7 +730,7 @@ fn set_alpha<'gc>(
}
fn visible<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
this: DisplayObject<'gc>,
) -> Result<Value<'gc>, Error<'gc>> {
@ -739,7 +739,7 @@ fn visible<'gc>(
}
fn set_visible<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
mut this: DisplayObject<'gc>,
val: Value<'gc>,
@ -753,7 +753,7 @@ fn set_visible<'gc>(
}
fn width<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
this: DisplayObject<'gc>,
) -> Result<Value<'gc>, Error<'gc>> {
@ -761,7 +761,7 @@ fn width<'gc>(
}
fn set_width<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
mut this: DisplayObject<'gc>,
val: Value<'gc>,
@ -773,7 +773,7 @@ fn set_width<'gc>(
}
fn height<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
this: DisplayObject<'gc>,
) -> Result<Value<'gc>, Error<'gc>> {
@ -781,7 +781,7 @@ fn height<'gc>(
}
fn set_height<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
mut this: DisplayObject<'gc>,
val: Value<'gc>,
@ -793,7 +793,7 @@ fn set_height<'gc>(
}
fn rotation<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
mut this: DisplayObject<'gc>,
) -> Result<Value<'gc>, Error<'gc>> {
@ -801,7 +801,7 @@ fn rotation<'gc>(
}
fn set_rotation<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
mut this: DisplayObject<'gc>,
degrees: Value<'gc>,
@ -820,7 +820,7 @@ fn set_rotation<'gc>(
}
fn target<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
this: DisplayObject<'gc>,
) -> Result<Value<'gc>, Error<'gc>> {
@ -828,7 +828,7 @@ fn target<'gc>(
}
fn frames_loaded<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
this: DisplayObject<'gc>,
) -> Result<Value<'gc>, Error<'gc>> {
@ -840,7 +840,7 @@ fn frames_loaded<'gc>(
}
fn name<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
this: DisplayObject<'gc>,
) -> Result<Value<'gc>, Error<'gc>> {
@ -848,7 +848,7 @@ fn name<'gc>(
}
fn set_name<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
mut this: DisplayObject<'gc>,
val: Value<'gc>,
@ -859,7 +859,7 @@ fn set_name<'gc>(
}
fn drop_target<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: DisplayObject<'gc>,
) -> Result<Value<'gc>, Error<'gc>> {
@ -868,7 +868,7 @@ fn drop_target<'gc>(
}
fn url<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: DisplayObject<'gc>,
) -> Result<Value<'gc>, Error<'gc>> {
@ -877,7 +877,7 @@ fn url<'gc>(
}
fn high_quality<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: DisplayObject<'gc>,
) -> Result<Value<'gc>, Error<'gc>> {
@ -886,7 +886,7 @@ fn high_quality<'gc>(
}
fn set_high_quality<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: DisplayObject<'gc>,
_val: Value<'gc>,
@ -896,7 +896,7 @@ fn set_high_quality<'gc>(
}
fn focus_rect<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: DisplayObject<'gc>,
) -> Result<Value<'gc>, Error<'gc>> {
@ -905,7 +905,7 @@ fn focus_rect<'gc>(
}
fn set_focus_rect<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: DisplayObject<'gc>,
_val: Value<'gc>,
@ -915,7 +915,7 @@ fn set_focus_rect<'gc>(
}
fn sound_buf_time<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: DisplayObject<'gc>,
) -> Result<Value<'gc>, Error<'gc>> {
@ -924,7 +924,7 @@ fn sound_buf_time<'gc>(
}
fn set_sound_buf_time<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: DisplayObject<'gc>,
_val: Value<'gc>,
@ -934,7 +934,7 @@ fn set_sound_buf_time<'gc>(
}
fn quality<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: DisplayObject<'gc>,
) -> Result<Value<'gc>, Error<'gc>> {
@ -943,7 +943,7 @@ fn quality<'gc>(
}
fn set_quality<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: DisplayObject<'gc>,
_val: Value<'gc>,
@ -953,7 +953,7 @@ fn set_quality<'gc>(
}
fn x_mouse<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: DisplayObject<'gc>,
) -> Result<Value<'gc>, Error<'gc>> {
@ -962,7 +962,7 @@ fn x_mouse<'gc>(
}
fn y_mouse<'gc>(
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: DisplayObject<'gc>,
) -> Result<Value<'gc>, Error<'gc>> {
@ -971,7 +971,7 @@ fn y_mouse<'gc>(
}
fn property_coerce_to_number<'gc>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
value: Value<'gc>,
) -> Result<Option<f64>, Error<'gc>> {

View File

@ -1,11 +1,11 @@
//! Special object that implements `super`
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::function::Executable;
use crate::avm1::object::search_prototype;
use crate::avm1::property::Attribute;
use crate::avm1::script_object::TYPE_OF_OBJECT;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{Object, ObjectPtr, ScriptObject, TObject, Value};
use crate::context::UpdateContext;
use crate::display_object::DisplayObject;
@ -45,7 +45,7 @@ impl<'gc> SuperObject<'gc> {
pub fn from_this_and_base_proto(
this: Object<'gc>,
base_proto: Object<'gc>,
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<Self, Error<'gc>> {
Ok(Self(GcCell::allocate(
@ -65,7 +65,7 @@ impl<'gc> SuperObject<'gc> {
/// Retrieve the constructor associated with the super proto.
fn super_constr(
self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<Option<Object<'gc>>, Error<'gc>> {
if let Some(super_proto) = self.super_proto() {
@ -84,7 +84,7 @@ impl<'gc> TObject<'gc> for SuperObject<'gc> {
fn get_local(
&self,
_name: &str,
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
) -> Result<Value<'gc>, Error<'gc>> {
@ -95,7 +95,7 @@ impl<'gc> TObject<'gc> for SuperObject<'gc> {
&self,
_name: &str,
_value: Value<'gc>,
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<(), Error<'gc>> {
//TODO: What happens if you set `super.__proto__`?
@ -104,7 +104,7 @@ impl<'gc> TObject<'gc> for SuperObject<'gc> {
fn call(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_base_proto: Option<Object<'gc>>,
@ -127,7 +127,7 @@ impl<'gc> TObject<'gc> for SuperObject<'gc> {
&self,
name: &str,
args: &[Value<'gc>],
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<Value<'gc>, Error<'gc>> {
let child = self.0.read().child;
@ -147,7 +147,7 @@ impl<'gc> TObject<'gc> for SuperObject<'gc> {
&self,
name: &str,
value: Value<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Option<Executable<'gc>> {
self.0
@ -159,7 +159,7 @@ impl<'gc> TObject<'gc> for SuperObject<'gc> {
#[allow(clippy::new_ret_no_self)]
fn new(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
args: &[Value<'gc>],
@ -175,7 +175,7 @@ impl<'gc> TObject<'gc> for SuperObject<'gc> {
fn delete(
&self,
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_gc_context: MutationContext<'gc, '_>,
_name: &str,
) -> bool {
@ -226,7 +226,7 @@ impl<'gc> TObject<'gc> for SuperObject<'gc> {
fn add_property_with_case(
&self,
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_gc_context: MutationContext<'gc, '_>,
_name: &str,
_get: Executable<'gc>,
@ -238,7 +238,7 @@ impl<'gc> TObject<'gc> for SuperObject<'gc> {
fn has_property(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
name: &str,
) -> bool {
@ -247,7 +247,7 @@ impl<'gc> TObject<'gc> for SuperObject<'gc> {
fn has_own_property(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
name: &str,
) -> bool {
@ -259,7 +259,7 @@ impl<'gc> TObject<'gc> for SuperObject<'gc> {
fn has_own_virtual(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
name: &str,
) -> bool {
@ -269,18 +269,18 @@ impl<'gc> TObject<'gc> for SuperObject<'gc> {
.has_own_virtual(activation, context, name)
}
fn is_property_enumerable(&self, activation: &mut StackFrame<'_, 'gc>, name: &str) -> bool {
fn is_property_enumerable(&self, activation: &mut Activation<'_, 'gc>, name: &str) -> bool {
self.0.read().child.is_property_enumerable(activation, name)
}
fn is_property_overwritable(&self, activation: &mut StackFrame<'_, 'gc>, name: &str) -> bool {
fn is_property_overwritable(&self, activation: &mut Activation<'_, 'gc>, name: &str) -> bool {
self.0
.read()
.child
.is_property_overwritable(activation, name)
}
fn get_keys(&self, _activation: &mut StackFrame<'_, 'gc>) -> Vec<String> {
fn get_keys(&self, _activation: &mut Activation<'_, 'gc>) -> Vec<String> {
vec![]
}

View File

@ -1,6 +1,6 @@
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::globals::system::SystemProperties;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{Avm1, Object, UpdateContext};
use crate::backend::audio::NullAudioBackend;
use crate::backend::input::NullInputBackend;
@ -21,7 +21,7 @@ use std::sync::Arc;
pub fn with_avm<F>(swf_version: u8, test: F)
where
F: for<'a, 'gc> FnOnce(
&mut StackFrame<'_, 'gc>,
&mut Activation<'_, 'gc>,
&mut UpdateContext<'a, 'gc, '_>,
Object<'gc>,
) -> Result<(), Error<'gc>>,
@ -29,7 +29,7 @@ where
fn in_the_arena<'a, 'gc: 'a, F>(swf_version: u8, test: F, gc_context: MutationContext<'gc, '_>)
where
F: FnOnce(
&mut StackFrame<'_, 'gc>,
&mut Activation<'_, 'gc>,
&mut UpdateContext<'_, 'gc, '_>,
Object<'gc>,
) -> Result<(), Error<'gc>>,
@ -78,13 +78,13 @@ where
root.set_name(context.gc_context, "");
fn run_test<'a, 'gc: 'a, F>(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
root: DisplayObject<'gc>,
test: F,
) where
F: FnOnce(
&mut StackFrame<'_, 'gc>,
&mut Activation<'_, 'gc>,
&mut UpdateContext<'_, 'gc, '_>,
Object<'gc>,
) -> Result<(), Error<'gc>>,
@ -97,7 +97,7 @@ where
}
let globals = avm.global_object_cell();
let mut activation = StackFrame::from_nothing(
let mut activation = Activation::from_nothing(
&mut avm,
context.swf.version(),
globals,

View File

@ -1,5 +1,5 @@
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::value_object::ValueObject;
use crate::avm1::{Object, TObject, UpdateContext};
use std::borrow::Cow;
@ -158,7 +158,7 @@ impl<'gc> Value<'gc> {
/// * In SWF5 and lower, hexadecimal is unsupported.
fn primitive_as_number(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
) -> f64 {
match self {
@ -224,7 +224,7 @@ impl<'gc> Value<'gc> {
/// ECMA-262 2nd edition s. 9.3 ToNumber
pub fn coerce_to_f64(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<f64, Error<'gc>> {
Ok(match self {
@ -248,7 +248,7 @@ impl<'gc> Value<'gc> {
/// return `undefined` rather than yielding a runtime error.
pub fn to_primitive_num(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<Value<'gc>, Error<'gc>> {
Ok(match self {
@ -262,7 +262,7 @@ impl<'gc> Value<'gc> {
pub fn abstract_lt(
&self,
other: Value<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<Value<'gc>, Error<'gc>> {
let prim_self = self.to_primitive_num(activation, context)?;
@ -302,7 +302,7 @@ impl<'gc> Value<'gc> {
pub fn abstract_eq(
&self,
other: Value<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
coerced: bool,
) -> Result<Value<'gc>, Error<'gc>> {
@ -409,7 +409,7 @@ impl<'gc> Value<'gc> {
#[allow(dead_code)]
pub fn coerce_to_u16(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<u16, Error<'gc>> {
self.coerce_to_f64(activation, context)
@ -422,7 +422,7 @@ impl<'gc> Value<'gc> {
#[allow(dead_code)]
pub fn coerce_to_i16(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<i16, Error<'gc>> {
self.coerce_to_f64(activation, context)
@ -436,7 +436,7 @@ impl<'gc> Value<'gc> {
#[allow(dead_code)]
pub fn coerce_to_i32(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<i32, Error<'gc>> {
self.coerce_to_f64(activation, context)
@ -449,7 +449,7 @@ impl<'gc> Value<'gc> {
#[allow(dead_code)]
pub fn coerce_to_u32(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<u32, Error<'gc>> {
self.coerce_to_f64(activation, context)
@ -459,7 +459,7 @@ impl<'gc> Value<'gc> {
/// Coerce a value to a string.
pub fn coerce_to_string<'a>(
&'a self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<Cow<'a, str>, Error<'gc>> {
Ok(match self {
@ -517,7 +517,7 @@ impl<'gc> Value<'gc> {
pub fn coerce_to_object(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Object<'gc> {
ValueObject::boxed(activation, context, self.to_owned())
@ -525,7 +525,7 @@ impl<'gc> Value<'gc> {
pub fn call(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
base_proto: Option<Object<'gc>>,
@ -600,12 +600,12 @@ pub fn f64_to_wrapping_i32(n: f64) -> i32 {
#[cfg(test)]
mod test {
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::function::{Executable, FunctionObject};
use crate::avm1::globals::create_globals;
use crate::avm1::object::{Object, TObject};
use crate::avm1::script_object::ScriptObject;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::test_utils::with_avm;
use crate::avm1::Value;
use crate::context::UpdateContext;
@ -643,7 +643,7 @@ mod test {
);
fn value_of_impl<'gc>(
_: &mut StackFrame<'_, 'gc>,
_: &mut Activation<'_, 'gc>,
_: &mut UpdateContext<'_, 'gc, '_>,
_: Object<'gc>,
_: &[Value<'gc>],

View File

@ -1,10 +1,10 @@
//! Object impl for boxed values
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::function::Executable;
use crate::avm1::object::{ObjectPtr, TObject};
use crate::avm1::property::Attribute;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{Object, ScriptObject, UpdateContext, Value};
use enumset::EnumSet;
use gc_arena::{Collect, GcCell, MutationContext};
@ -40,7 +40,7 @@ impl<'gc> ValueObject<'gc> {
/// If a class exists for a given value type, this function automatically
/// selects the correct prototype for it from the system prototypes list.
pub fn boxed(
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
value: Value<'gc>,
) -> Object<'gc> {
@ -135,7 +135,7 @@ impl<'gc> TObject<'gc> for ValueObject<'gc> {
fn get_local(
&self,
name: &str,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
) -> Result<Value<'gc>, Error<'gc>> {
@ -149,7 +149,7 @@ impl<'gc> TObject<'gc> for ValueObject<'gc> {
&self,
name: &str,
value: Value<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<(), Error<'gc>> {
self.0.read().base.set(name, value, activation, context)
@ -157,7 +157,7 @@ impl<'gc> TObject<'gc> for ValueObject<'gc> {
fn call(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
base_proto: Option<Object<'gc>>,
@ -173,7 +173,7 @@ impl<'gc> TObject<'gc> for ValueObject<'gc> {
&self,
name: &str,
value: Value<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Option<Executable<'gc>> {
self.0
@ -185,7 +185,7 @@ impl<'gc> TObject<'gc> for ValueObject<'gc> {
#[allow(clippy::new_ret_no_self)]
fn new(
&self,
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -195,7 +195,7 @@ impl<'gc> TObject<'gc> for ValueObject<'gc> {
fn delete(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
gc_context: MutationContext<'gc, '_>,
name: &str,
) -> bool {
@ -218,7 +218,7 @@ impl<'gc> TObject<'gc> for ValueObject<'gc> {
fn add_property_with_case(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
gc_context: MutationContext<'gc, '_>,
name: &str,
get: Executable<'gc>,
@ -272,7 +272,7 @@ impl<'gc> TObject<'gc> for ValueObject<'gc> {
fn has_property(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
name: &str,
) -> bool {
@ -281,7 +281,7 @@ impl<'gc> TObject<'gc> for ValueObject<'gc> {
fn has_own_property(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
name: &str,
) -> bool {
@ -293,7 +293,7 @@ impl<'gc> TObject<'gc> for ValueObject<'gc> {
fn has_own_virtual(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
name: &str,
) -> bool {
@ -303,18 +303,18 @@ impl<'gc> TObject<'gc> for ValueObject<'gc> {
.has_own_virtual(activation, context, name)
}
fn is_property_overwritable(&self, activation: &mut StackFrame<'_, 'gc>, name: &str) -> bool {
fn is_property_overwritable(&self, activation: &mut Activation<'_, 'gc>, name: &str) -> bool {
self.0
.read()
.base
.is_property_overwritable(activation, name)
}
fn is_property_enumerable(&self, activation: &mut StackFrame<'_, 'gc>, name: &str) -> bool {
fn is_property_enumerable(&self, activation: &mut Activation<'_, 'gc>, name: &str) -> bool {
self.0.read().base.is_property_enumerable(activation, name)
}
fn get_keys(&self, activation: &mut StackFrame<'_, 'gc>) -> Vec<String> {
fn get_keys(&self, activation: &mut Activation<'_, 'gc>) -> Vec<String> {
self.0.read().base.get_keys(activation)
}

View File

@ -1,10 +1,10 @@
//! AVM1 object type to represent the attributes of XML nodes
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::function::Executable;
use crate::avm1::object::{ObjectPtr, TObject};
use crate::avm1::property::Attribute;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{Object, ScriptObject, UpdateContext, Value};
use crate::xml::{XMLName, XMLNode};
use enumset::EnumSet;
@ -60,7 +60,7 @@ impl<'gc> TObject<'gc> for XMLAttributesObject<'gc> {
fn get_local(
&self,
name: &str,
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
) -> Result<Value<'gc>, Error<'gc>> {
@ -75,7 +75,7 @@ impl<'gc> TObject<'gc> for XMLAttributesObject<'gc> {
&self,
name: &str,
value: Value<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<(), Error<'gc>> {
self.node().set_attribute_value(
@ -88,7 +88,7 @@ impl<'gc> TObject<'gc> for XMLAttributesObject<'gc> {
fn call(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
base_proto: Option<Object<'gc>>,
@ -102,7 +102,7 @@ impl<'gc> TObject<'gc> for XMLAttributesObject<'gc> {
&self,
name: &str,
value: Value<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Option<Executable<'gc>> {
self.base().call_setter(name, value, activation, context)
@ -111,7 +111,7 @@ impl<'gc> TObject<'gc> for XMLAttributesObject<'gc> {
#[allow(clippy::new_ret_no_self)]
fn new(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -123,7 +123,7 @@ impl<'gc> TObject<'gc> for XMLAttributesObject<'gc> {
fn delete(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
gc_context: MutationContext<'gc, '_>,
name: &str,
) -> bool {
@ -146,7 +146,7 @@ impl<'gc> TObject<'gc> for XMLAttributesObject<'gc> {
fn add_property_with_case(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
gc_context: MutationContext<'gc, '_>,
name: &str,
get: Executable<'gc>,
@ -189,7 +189,7 @@ impl<'gc> TObject<'gc> for XMLAttributesObject<'gc> {
fn has_property(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
name: &str,
) -> bool {
@ -198,7 +198,7 @@ impl<'gc> TObject<'gc> for XMLAttributesObject<'gc> {
fn has_own_property(
&self,
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
_context: &mut UpdateContext<'_, 'gc, '_>,
name: &str,
) -> bool {
@ -209,22 +209,22 @@ impl<'gc> TObject<'gc> for XMLAttributesObject<'gc> {
fn has_own_virtual(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
name: &str,
) -> bool {
self.base().has_own_virtual(activation, context, name)
}
fn is_property_overwritable(&self, activation: &mut StackFrame<'_, 'gc>, name: &str) -> bool {
fn is_property_overwritable(&self, activation: &mut Activation<'_, 'gc>, name: &str) -> bool {
self.base().is_property_overwritable(activation, name)
}
fn is_property_enumerable(&self, activation: &mut StackFrame<'_, 'gc>, name: &str) -> bool {
fn is_property_enumerable(&self, activation: &mut Activation<'_, 'gc>, name: &str) -> bool {
self.base().is_property_enumerable(activation, name)
}
fn get_keys(&self, activation: &mut StackFrame<'_, 'gc>) -> Vec<String> {
fn get_keys(&self, activation: &mut Activation<'_, 'gc>) -> Vec<String> {
self.base().get_keys(activation)
}

View File

@ -1,10 +1,10 @@
//! AVM1 object type to represent the attributes of XML nodes
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::function::Executable;
use crate::avm1::object::{ObjectPtr, TObject};
use crate::avm1::property::Attribute;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{Object, ScriptObject, UpdateContext, Value};
use crate::xml::{XMLDocument, XMLNode};
use enumset::EnumSet;
@ -60,7 +60,7 @@ impl<'gc> TObject<'gc> for XMLIDMapObject<'gc> {
fn get_local(
&self,
name: &str,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
) -> Result<Value<'gc>, Error<'gc>> {
@ -80,7 +80,7 @@ impl<'gc> TObject<'gc> for XMLIDMapObject<'gc> {
&self,
name: &str,
value: Value<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<(), Error<'gc>> {
self.base().set(name, value, activation, context)
@ -88,7 +88,7 @@ impl<'gc> TObject<'gc> for XMLIDMapObject<'gc> {
fn call(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
base_proto: Option<Object<'gc>>,
@ -102,7 +102,7 @@ impl<'gc> TObject<'gc> for XMLIDMapObject<'gc> {
&self,
name: &str,
value: Value<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Option<Executable<'gc>> {
self.base().call_setter(name, value, activation, context)
@ -111,7 +111,7 @@ impl<'gc> TObject<'gc> for XMLIDMapObject<'gc> {
#[allow(clippy::new_ret_no_self)]
fn new(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
_this: Object<'gc>,
_args: &[Value<'gc>],
@ -123,7 +123,7 @@ impl<'gc> TObject<'gc> for XMLIDMapObject<'gc> {
fn delete(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
gc_context: MutationContext<'gc, '_>,
name: &str,
) -> bool {
@ -144,7 +144,7 @@ impl<'gc> TObject<'gc> for XMLIDMapObject<'gc> {
fn add_property_with_case(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
gc_context: MutationContext<'gc, '_>,
name: &str,
get: Executable<'gc>,
@ -187,7 +187,7 @@ impl<'gc> TObject<'gc> for XMLIDMapObject<'gc> {
fn has_property(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
name: &str,
) -> bool {
@ -196,7 +196,7 @@ impl<'gc> TObject<'gc> for XMLIDMapObject<'gc> {
fn has_own_property(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
name: &str,
) -> bool {
@ -206,22 +206,22 @@ impl<'gc> TObject<'gc> for XMLIDMapObject<'gc> {
fn has_own_virtual(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
name: &str,
) -> bool {
self.base().has_own_virtual(activation, context, name)
}
fn is_property_overwritable(&self, activation: &mut StackFrame<'_, 'gc>, name: &str) -> bool {
fn is_property_overwritable(&self, activation: &mut Activation<'_, 'gc>, name: &str) -> bool {
self.base().is_property_overwritable(activation, name)
}
fn is_property_enumerable(&self, activation: &mut StackFrame<'_, 'gc>, name: &str) -> bool {
fn is_property_enumerable(&self, activation: &mut Activation<'_, 'gc>, name: &str) -> bool {
self.base().is_property_enumerable(activation, name)
}
fn get_keys(&self, activation: &mut StackFrame<'_, 'gc>) -> Vec<String> {
fn get_keys(&self, activation: &mut Activation<'_, 'gc>) -> Vec<String> {
let mut keys = self.base().get_keys(activation);
keys.extend(self.document().get_node_ids().into_iter());
keys

View File

@ -1,10 +1,10 @@
//! AVM1 object type to represent XML nodes
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::function::Executable;
use crate::avm1::object::{ObjectPtr, TObject};
use crate::avm1::property::Attribute;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{Object, ScriptObject, UpdateContext, Value};
use crate::xml::{XMLDocument, XMLNode};
use enumset::EnumSet;
@ -61,7 +61,7 @@ impl<'gc> TObject<'gc> for XMLObject<'gc> {
fn get_local(
&self,
name: &str,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
) -> Result<Value<'gc>, Error<'gc>> {
@ -72,7 +72,7 @@ impl<'gc> TObject<'gc> for XMLObject<'gc> {
&self,
name: &str,
value: Value<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<(), Error<'gc>> {
self.base().set(name, value, activation, context)
@ -80,7 +80,7 @@ impl<'gc> TObject<'gc> for XMLObject<'gc> {
fn call(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
base_proto: Option<Object<'gc>>,
@ -94,7 +94,7 @@ impl<'gc> TObject<'gc> for XMLObject<'gc> {
&self,
name: &str,
value: Value<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) -> Option<Executable<'gc>> {
self.base().call_setter(name, value, activation, context)
@ -103,7 +103,7 @@ impl<'gc> TObject<'gc> for XMLObject<'gc> {
#[allow(clippy::new_ret_no_self)]
fn new(
&self,
_activation: &mut StackFrame<'_, 'gc>,
_activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
this: Object<'gc>,
_args: &[Value<'gc>],
@ -113,7 +113,7 @@ impl<'gc> TObject<'gc> for XMLObject<'gc> {
fn delete(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
gc_context: MutationContext<'gc, '_>,
name: &str,
) -> bool {
@ -134,7 +134,7 @@ impl<'gc> TObject<'gc> for XMLObject<'gc> {
fn add_property_with_case(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
gc_context: MutationContext<'gc, '_>,
name: &str,
get: Executable<'gc>,
@ -177,7 +177,7 @@ impl<'gc> TObject<'gc> for XMLObject<'gc> {
fn has_property(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
name: &str,
) -> bool {
@ -186,7 +186,7 @@ impl<'gc> TObject<'gc> for XMLObject<'gc> {
fn has_own_property(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
name: &str,
) -> bool {
@ -195,22 +195,22 @@ impl<'gc> TObject<'gc> for XMLObject<'gc> {
fn has_own_virtual(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
name: &str,
) -> bool {
self.base().has_own_virtual(activation, context, name)
}
fn is_property_overwritable(&self, activation: &mut StackFrame<'_, 'gc>, name: &str) -> bool {
fn is_property_overwritable(&self, activation: &mut Activation<'_, 'gc>, name: &str) -> bool {
self.base().is_property_overwritable(activation, name)
}
fn is_property_enumerable(&self, activation: &mut StackFrame<'_, 'gc>, name: &str) -> bool {
fn is_property_enumerable(&self, activation: &mut Activation<'_, 'gc>, name: &str) -> bool {
self.base().is_property_enumerable(activation, name)
}
fn get_keys(&self, activation: &mut StackFrame<'_, 'gc>) -> Vec<String> {
fn get_keys(&self, activation: &mut Activation<'_, 'gc>) -> Vec<String> {
self.base().get_keys(activation)
}

View File

@ -20,7 +20,7 @@ mod morph_shape;
mod movie_clip;
mod text;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::activation::Activation;
use crate::events::{ClipEvent, ClipEventResult};
pub use bitmap::Bitmap;
pub use button::Button;
@ -914,7 +914,7 @@ pub trait TDisplayObject<'gc>: 'gc + Collect + Debug + Into<DisplayObject<'gc>>
fn bind_text_field_variables(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) {
// Check all unbound text fields to see if they apply to this object.

View File

@ -1,6 +1,6 @@
//! `EditText` display object and support code.
use crate::avm1::activation::Activation;
use crate::avm1::globals::text_field::attach_virtual_properties;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{Avm1, Object, StageObject, TObject, Value};
use crate::context::{RenderContext, UpdateContext};
use crate::display_object::{DisplayObjectBase, TDisplayObject};
@ -503,7 +503,7 @@ impl<'gc> EditText<'gc> {
pub fn set_variable(
self,
variable: Option<String>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) {
// Clear previous binding.
@ -699,7 +699,7 @@ impl<'gc> EditText<'gc> {
/// This is called when the text field is created, and, if the text field is in the unbound list, anytime a display object is created.
pub fn try_bind_text_field_variable(
self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
set_initial_value: bool,
) -> bool {
@ -771,7 +771,7 @@ impl<'gc> EditText<'gc> {
///
pub fn propagate_text_binding(
self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
context: &mut UpdateContext<'_, 'gc, '_>,
) {
if !self.0.read().firing_variable_binding {

View File

@ -2,7 +2,7 @@
use crate::avm1::{Avm1, Object, StageObject, TObject, Value};
use crate::backend::audio::AudioStreamHandle;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::activation::Activation;
use crate::character::Character;
use crate::context::{ActionType, RenderContext, UpdateContext};
use crate::display_object::{
@ -975,7 +975,7 @@ impl<'gc> TDisplayObject<'gc> for MovieClip<'gc> {
return Some(self_node);
}
let mut activation = StackFrame::from_nothing(
let mut activation = Activation::from_nothing(
avm,
context.swf.version(),
avm.global_object_cell(),
@ -1040,7 +1040,7 @@ impl<'gc> TDisplayObject<'gc> for MovieClip<'gc> {
// If we are running within the AVM, this must be an immediate action.
// If we are not, then this must be queued to be ran first-thing
if instantiated_from_avm && self.0.read().avm1_constructor.is_some() {
let mut activation = StackFrame::from_nothing(
let mut activation = Activation::from_nothing(
avm,
context.swf.version(),
avm.global_object_cell(),
@ -1079,7 +1079,7 @@ impl<'gc> TDisplayObject<'gc> for MovieClip<'gc> {
Some(context.system_prototypes.movie_clip),
);
if let Some(init_object) = init_object {
let mut activation = StackFrame::from_nothing(
let mut activation = Activation::from_nothing(
avm,
context.swf.version(),
avm.global_object_cell(),

View File

@ -1,5 +1,5 @@
//! Classes that store formatting options
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::activation::Activation;
use crate::avm1::{Object, ScriptObject, TObject, Value};
use crate::context::UpdateContext;
use crate::html::iterators::TextSpanIter;
@ -86,7 +86,7 @@ pub struct TextFormat {
fn getstr_from_avm1_object<'gc>(
object: Object<'gc>,
name: &str,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
uc: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<Option<String>, crate::avm1::error::Error<'gc>> {
Ok(match object.get(name, activation, uc)? {
@ -99,7 +99,7 @@ fn getstr_from_avm1_object<'gc>(
fn getfloat_from_avm1_object<'gc>(
object: Object<'gc>,
name: &str,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
uc: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<Option<f64>, crate::avm1::error::Error<'gc>> {
Ok(match object.get(name, activation, uc)? {
@ -112,7 +112,7 @@ fn getfloat_from_avm1_object<'gc>(
fn getbool_from_avm1_object<'gc>(
object: Object<'gc>,
name: &str,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
uc: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<Option<bool>, crate::avm1::error::Error<'gc>> {
Ok(match object.get(name, activation, uc)? {
@ -125,7 +125,7 @@ fn getbool_from_avm1_object<'gc>(
fn getfloatarray_from_avm1_object<'gc>(
object: Object<'gc>,
name: &str,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
uc: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<Option<Vec<f64>>, crate::avm1::error::Error<'gc>> {
Ok(match object.get(name, activation, uc)? {
@ -198,7 +198,7 @@ impl TextFormat {
/// Construct a `TextFormat` from an object that is
pub fn from_avm1_object<'gc>(
object1: Object<'gc>,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
uc: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<Self, crate::avm1::error::Error<'gc>> {
Ok(Self {
@ -352,7 +352,7 @@ impl TextFormat {
/// Construct a `TextFormat` AVM1 object from this text format object.
pub fn as_avm1_object<'gc>(
&self,
activation: &mut StackFrame<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
uc: &mut UpdateContext<'_, 'gc, '_>,
) -> Result<Object<'gc>, crate::avm1::error::Error<'gc>> {
let object = ScriptObject::object(

View File

@ -1,6 +1,6 @@
//! Management of async loaders
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::activation::Activation;
use crate::avm1::{Object, TObject, Value};
use crate::backend::navigator::OwnedFuture;
use crate::context::{ActionQueue, ActionType};
@ -474,7 +474,7 @@ impl<'gc> Loader<'gc> {
_ => return Err(Error::NotMovieLoader),
};
let mut activation = StackFrame::from_nothing(
let mut activation = Activation::from_nothing(
avm,
uc.swf.version(),
avm.global_object_cell(),

View File

@ -1,8 +1,8 @@
use crate::avm1::activation::Activation;
use crate::avm1::debug::VariableDumper;
use crate::avm1::globals::system::SystemProperties;
use crate::avm1::listeners::SystemListener;
use crate::avm1::object::Object;
use crate::avm1::stack_frame::StackFrame;
use crate::avm1::{Avm1, TObject, Value};
use crate::backend::input::{InputBackend, MouseCursor};
use crate::backend::storage::StorageBackend;
@ -272,7 +272,7 @@ impl Player {
root.set_name(context.gc_context, "");
context.levels.insert(0, root);
let mut activation = StackFrame::from_nothing(
let mut activation = Activation::from_nothing(
avm,
context.swf.version(),
avm.global_object_cell(),
@ -388,7 +388,7 @@ impl Player {
self.mutate_with_update_context(|avm, context| {
let mut dumper = VariableDumper::new(" ");
let mut activation = StackFrame::from_nothing(
let mut activation = Activation::from_nothing(
avm,
context.swf.version(),
avm.global_object_cell(),
@ -750,7 +750,7 @@ impl Player {
constructor: Some(constructor),
events,
} => {
let mut activation = StackFrame::from_nothing(
let mut activation = Activation::from_nothing(
avm,
context.swf.version(),
avm.global_object_cell(),
@ -1003,7 +1003,7 @@ impl Player {
pub fn flush_shared_objects(&mut self) {
self.update(|avm, context| {
let mut activation = StackFrame::from_nothing(
let mut activation = Activation::from_nothing(
avm,
context.swf.version(),
avm.global_object_cell(),