Implement `ActionImplementsOp`.
This commit title has won the "World's Lowest-Entropy Commit Title" award for 2019.
This commit is contained in:
parent
ee4b47d062
commit
1b459f522d
|
@ -416,6 +416,7 @@ impl<'gc> Avm1<'gc> {
|
|||
Action::Increment => self.action_increment(context),
|
||||
Action::InitArray => self.action_init_array(context),
|
||||
Action::InitObject => self.action_init_object(context),
|
||||
Action::ImplementsOp => self.action_implements_op(context),
|
||||
Action::InstanceOf => self.action_instance_of(context),
|
||||
Action::Jump { offset } => self.action_jump(context, offset, reader),
|
||||
Action::Less => self.action_less(context),
|
||||
|
@ -1342,6 +1343,25 @@ impl<'gc> Avm1<'gc> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
fn action_implements_op(
|
||||
&mut self,
|
||||
context: &mut UpdateContext<'_, 'gc, '_>,
|
||||
) -> Result<(), Error> {
|
||||
let constr = self.pop()?.as_object()?;
|
||||
let count = self.pop()?.as_i64()?; //TODO: Is this coercion actually performed by Flash?
|
||||
let mut interfaces = vec![];
|
||||
|
||||
//TODO: If one of the interfaces is not an object, do we leave the
|
||||
//whole stack dirty, or...?
|
||||
for _ in 0..count {
|
||||
interfaces.push(self.pop()?.as_object()?);
|
||||
}
|
||||
|
||||
constr.write(context.gc_context).set_interfaces(interfaces);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn action_instance_of(
|
||||
&mut self,
|
||||
context: &mut UpdateContext<'_, 'gc, '_>,
|
||||
|
|
Loading…
Reference in New Issue