avm1: Returning from with{} should return from the parent activation
This commit is contained in:
parent
4b4370b90d
commit
d1732dd3d6
|
@ -2241,9 +2241,12 @@ impl<'a, 'gc: 'a> Activation<'a, 'gc> {
|
||||||
let object = self.avm.pop().coerce_to_object(self, context);
|
let object = self.avm.pop().coerce_to_object(self, context);
|
||||||
let with_scope = Scope::new_with_scope(self.scope_cell(), object, context.gc_context);
|
let with_scope = Scope::new_with_scope(self.scope_cell(), object, context.gc_context);
|
||||||
let mut new_activation = self.with_new_scope(with_scope);
|
let mut new_activation = self.with_new_scope(with_scope);
|
||||||
let _ = new_activation.run_actions(context, code)?;
|
if let ReturnType::Explicit(value) = new_activation.run_actions(context, code)? {
|
||||||
|
Ok(FrameControl::Return(ReturnType::Explicit(value)))
|
||||||
|
} else {
|
||||||
Ok(FrameControl::Continue)
|
Ok(FrameControl::Continue)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Retrieve a given register value.
|
/// Retrieve a given register value.
|
||||||
///
|
///
|
||||||
|
|
|
@ -189,6 +189,7 @@ swf_tests! {
|
||||||
(loadvariablesnum, "avm1/loadvariablesnum", 3),
|
(loadvariablesnum, "avm1/loadvariablesnum", 3),
|
||||||
(loadvariables_method, "avm1/loadvariables_method", 3),
|
(loadvariables_method, "avm1/loadvariables_method", 3),
|
||||||
(xml_load, "avm1/xml_load", 1),
|
(xml_load, "avm1/xml_load", 1),
|
||||||
|
(with_return, "avm1/with_return", 1),
|
||||||
(cross_movie_root, "avm1/cross_movie_root", 5),
|
(cross_movie_root, "avm1/cross_movie_root", 5),
|
||||||
(roots_and_levels, "avm1/roots_and_levels", 1),
|
(roots_and_levels, "avm1/roots_and_levels", 1),
|
||||||
(swf6_case_insensitive, "avm1/swf6_case_insensitive", 1),
|
(swf6_case_insensitive, "avm1/swf6_case_insensitive", 1),
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
// test()
|
||||||
|
Success!
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue