@@ -343,11 +343,10 @@ impl<'a, 'gc> Activation<'a, 'gc> {
343343 active_clip : DisplayObject < ' gc > ,
344344 code : SwfSlice ,
345345 ) -> Result < ReturnType < ' gc > , Error < ' gc > > {
346- let mut parent_activation =
346+ // TODO(moulins): remove this activation, it's useless.
347+ let parent_activation =
347348 Activation :: from_nothing ( self . context , self . id . child ( "[Actions Parent]" ) , active_clip) ;
348- let clip_obj = active_clip
349- . object1_or_undef ( )
350- . coerce_to_object ( & mut parent_activation) ;
349+ let clip_obj = active_clip. object1_or_bare ( parent_activation. gc ( ) ) ;
351350 let child_scope = Gc :: new (
352351 parent_activation. gc ( ) ,
353352 Scope :: new (
@@ -866,7 +865,7 @@ impl<'a, 'gc> Activation<'a, 'gc> {
866865 let swf_version = self . swf_version ( ) ;
867866 let func_data = parent_data. to_unbounded_subslice ( action. actions ) ;
868867 let constant_pool = self . constant_pool ( ) ;
869- let bc = self . base_clip . object1_or_undef ( ) . coerce_to_object ( self ) ;
868+ let bc = self . base_clip . object1_or_bare ( self . gc ( ) ) ;
870869 let func = Avm1Function :: from_swf_function (
871870 self . gc ( ) ,
872871 swf_version,
@@ -1253,7 +1252,7 @@ impl<'a, 'gc> Activation<'a, 'gc> {
12531252 }
12541253 if is_load_vars {
12551254 if let Some ( clip_target) = clip_target {
1256- let target_obj = clip_target. object1_or_undef ( ) . coerce_to_object ( self ) ;
1255+ let target_obj = clip_target. object1_or_bare ( self . gc ( ) ) ;
12571256 let request = self . locals_into_request (
12581257 url,
12591258 NavigationMethod :: from_send_vars_method ( action. send_vars_method ( ) ) ,
@@ -1792,10 +1791,7 @@ impl<'a, 'gc> Activation<'a, 'gc> {
17921791 // Revert the target to the base clip, or `None` if the base was also removed
17931792 self . set_target_clip ( Some ( self . base_clip ( ) ) ) ;
17941793
1795- let clip_obj = self
1796- . target_clip_or_root ( )
1797- . object1_or_undef ( )
1798- . coerce_to_object ( self ) ;
1794+ let clip_obj = self . target_clip_or_root ( ) . object1_or_bare ( self . gc ( ) ) ;
17991795
18001796 self . set_scope ( Scope :: new_target_scope ( self . scope ( ) , clip_obj, self . gc ( ) ) ) ;
18011797 }
@@ -1940,10 +1936,7 @@ impl<'a, 'gc> Activation<'a, 'gc> {
19401936 }
19411937 } ;
19421938
1943- let clip_obj = self
1944- . target_clip_or_base_clip ( )
1945- . object1_or_undef ( )
1946- . coerce_to_object ( self ) ;
1939+ let clip_obj = self . target_clip_or_base_clip ( ) . object1_or_bare ( self . gc ( ) ) ;
19471940
19481941 self . set_scope ( Scope :: new_target_scope ( self . scope ( ) , clip_obj, self . gc ( ) ) ) ;
19491942 Ok ( FrameControl :: Continue )
@@ -2503,7 +2496,7 @@ impl<'a, 'gc> Activation<'a, 'gc> {
25032496 }
25042497
25052498 let root = start. avm1_root ( ) ;
2506- let start = start. object1_or_undef ( ) . coerce_to_object ( self ) ;
2499+ let start = start. object1_or_bare ( self . gc ( ) ) ;
25072500 Ok ( self
25082501 . resolve_target_path ( root, start, & path, false , true ) ?
25092502 . and_then ( |o| o. as_display_object ( ) ) )
@@ -2535,7 +2528,7 @@ impl<'a, 'gc> Activation<'a, 'gc> {
25352528 // (`/bar` means `_root.bar`)
25362529 let ( mut object, mut is_slash_path) = if path. starts_with ( b'/' ) {
25372530 path = & path[ 1 ..] ;
2538- ( root. object1_or_undef ( ) . coerce_to_object ( self ) , true )
2531+ ( root. object1_or_bare ( self . gc ( ) ) , true )
25392532 } else {
25402533 ( start, false )
25412534 } ;
@@ -2589,7 +2582,7 @@ impl<'a, 'gc> Activation<'a, 'gc> {
25892582 if first_element && name == b"this" {
25902583 self . this_cell ( )
25912584 } else if first_element && name == b"_root" {
2592- self . root_object ( )
2585+ self . base_clip ( ) . avm1_root ( ) . object1_or_undef ( )
25932586 } else {
25942587 // Get the value from the object.
25952588 // Resolves display object instances first, then local variables.
@@ -2869,11 +2862,6 @@ impl<'a, 'gc> Activation<'a, 'gc> {
28692862 self . target_clip ( ) . unwrap_or_else ( || self . base_clip ( ) )
28702863 }
28712864
2872- /// Obtain the value of `_root`.
2873- pub fn root_object ( & self ) -> Value < ' gc > {
2874- self . base_clip ( ) . avm1_root ( ) . object1_or_undef ( )
2875- }
2876-
28772865 /// Returns whether property keys should be case sensitive based on the current SWF version.
28782866 pub fn is_case_sensitive ( & self ) -> bool {
28792867 crate :: avm1:: runtime:: Avm1 :: is_case_sensitive ( self . swf_version ( ) )
@@ -2926,7 +2914,7 @@ impl<'a, 'gc> Activation<'a, 'gc> {
29262914 Scope :: new (
29272915 self . scope ,
29282916 ScopeClass :: Target ,
2929- object. object1_or_undef ( ) . coerce_to_object ( self ) ,
2917+ object. object1_or_bare ( self . gc ( ) ) ,
29302918 ) ,
29312919 ) ;
29322920 }
@@ -3022,7 +3010,7 @@ impl<'a, 'gc> Activation<'a, 'gc> {
30223010 let base_clip = self . base_clip ( ) ;
30233011 let new_target_clip;
30243012 let root = base_clip. avm1_root ( ) ;
3025- let start = base_clip. object1_or_undef ( ) . coerce_to_object ( self ) ;
3013+ let start = base_clip. object1_or_bare ( self . gc ( ) ) ;
30263014 if target. is_empty ( ) {
30273015 new_target_clip = Some ( base_clip) ;
30283016 } else if let Some ( clip) = self
@@ -3058,10 +3046,7 @@ impl<'a, 'gc> Activation<'a, 'gc> {
30583046
30593047 self . set_target_clip ( new_target_clip) ;
30603048
3061- let clip_obj = self
3062- . target_clip_or_root ( )
3063- . object1_or_undef ( )
3064- . coerce_to_object ( self ) ;
3049+ let clip_obj = self . target_clip_or_root ( ) . object1_or_bare ( self . gc ( ) ) ;
30653050
30663051 self . set_scope ( Scope :: new_target_scope ( self . scope ( ) , clip_obj, self . gc ( ) ) ) ;
30673052 Ok ( FrameControl :: Continue )
0 commit comments