@@ -1070,7 +1070,7 @@ impl<'a, 'gc> Activation<'a, 'gc> {
10701070 let object_val = self . context . avm1 . pop ( ) ;
10711071 let object = object_val. coerce_to_object ( self ) ;
10721072
1073- let result = object. get_non_slash_path ( name, self ) ?;
1073+ let result = object. get ( name, self ) ?;
10741074 self . stack_push ( result) ;
10751075
10761076 Ok ( FrameControl :: Continue )
@@ -2495,7 +2495,7 @@ impl<'a, 'gc> Activation<'a, 'gc> {
24952495 let root = start. avm1_root ( ) ;
24962496 let start = start. object1_or_bare ( self . gc ( ) ) ;
24972497 Ok ( self
2498- . resolve_target_path ( root, start, & path, false , true ) ?
2498+ . resolve_target_path ( root, start, & path, false ) ?
24992499 . and_then ( |o| o. as_display_object ( ) ) )
25002500 }
25012501
@@ -2514,7 +2514,6 @@ impl<'a, 'gc> Activation<'a, 'gc> {
25142514 start : Object < ' gc > ,
25152515 mut path : & WStr ,
25162516 mut first_element : bool ,
2517- path_has_slash : bool ,
25182517 ) -> Result < Option < Object < ' gc > > , Error < ' gc > > {
25192518 // Empty path resolves immediately to start clip.
25202519 if path. is_empty ( ) {
@@ -2589,26 +2588,15 @@ impl<'a, 'gc> Activation<'a, 'gc> {
25892588 . and_then ( |o| o. as_container ( ) )
25902589 . and_then ( |o| o. child_by_name ( name, case_sensitive) )
25912590 {
2592- if path_has_slash {
2593- child. object1_or_undef ( )
2594- } else if child. object1 ( ) . is_none ( ) {
2595- // If an object doesn't have an object representation,
2596- // e.g. Graphic, then trying to access it returns
2597- // the parent instead
2598- child
2599- . parent ( )
2600- . map ( |p| p. object1_or_undef ( ) )
2601- . unwrap_or ( Value :: Undefined )
2602- } else {
2603- child. object1_or_undef ( )
2604- }
2591+ child
2592+ . object1 ( )
2593+ // If an object doesn't have an object representation, e.g. Graphic,
2594+ // then trying to access it returns the parent instead
2595+ . or_else ( || child. parent ( ) . and_then ( |p| p. object1 ( ) ) )
2596+ . map_or ( Value :: Undefined , Value :: from)
26052597 } else {
26062598 let name = AvmString :: new ( self . gc ( ) , name) ;
2607- if path_has_slash {
2608- object. get ( name, self ) . unwrap ( )
2609- } else {
2610- object. get_non_slash_path ( name, self ) . unwrap ( )
2611- }
2599+ object. get ( name, self ) . unwrap ( )
26122600 }
26132601 }
26142602 } ;
@@ -2636,8 +2624,6 @@ impl<'a, 'gc> Activation<'a, 'gc> {
26362624 start : DisplayObject < ' gc > ,
26372625 path : & ' s WStr ,
26382626 ) -> Result < Option < ( Object < ' gc > , & ' s WStr ) > , Error < ' gc > > {
2639- let path_has_slash = path. contains ( b'/' ) ;
2640-
26412627 // Find the right-most : or . in the path.
26422628 // If we have one, we must resolve as a target path.
26432629 if let Some ( separator) = path. rfind ( b":." . as_ref ( ) ) {
@@ -2648,13 +2634,9 @@ impl<'a, 'gc> Activation<'a, 'gc> {
26482634 for scope in Scope :: ancestors ( self . scope ( ) ) {
26492635 let avm1_root = start. avm1_root ( ) ;
26502636
2651- if let Some ( object) = self . resolve_target_path (
2652- avm1_root,
2653- * scope. locals ( ) ,
2654- path,
2655- true ,
2656- path_has_slash,
2657- ) ? {
2637+ if let Some ( object) =
2638+ self . resolve_target_path ( avm1_root, * scope. locals ( ) , path, true ) ?
2639+ {
26582640 return Ok ( Some ( ( object, var_name) ) ) ;
26592641 }
26602642 }
@@ -2692,8 +2674,6 @@ impl<'a, 'gc> Activation<'a, 'gc> {
26922674 // Resolve a variable path for a GetVariable action.
26932675 let start = self . target_clip_or_root ( ) ;
26942676
2695- let path_has_slash = path. contains ( b'/' ) ;
2696-
26972677 // Find the right-most : or . in the path.
26982678 // If we have one, we must resolve as a target path.
26992679 if let Some ( separator) = path. rfind ( b":." . as_ref ( ) ) {
@@ -2704,13 +2684,9 @@ impl<'a, 'gc> Activation<'a, 'gc> {
27042684 for scope in Scope :: ancestors ( self . scope ( ) ) {
27052685 let avm1_root = start. avm1_root ( ) ;
27062686
2707- if let Some ( object) = self . resolve_target_path (
2708- avm1_root,
2709- * scope. locals ( ) ,
2710- path,
2711- true ,
2712- path_has_slash,
2713- ) ? {
2687+ if let Some ( object) =
2688+ self . resolve_target_path ( avm1_root, * scope. locals ( ) , path, true ) ?
2689+ {
27142690 let var_name = AvmString :: new ( self . gc ( ) , var_name) ;
27152691 if object. has_property ( self , var_name) {
27162692 return Ok ( CallableValue :: Callable ( object, object. get ( var_name, self ) ?) ) ;
@@ -2727,7 +2703,7 @@ impl<'a, 'gc> Activation<'a, 'gc> {
27272703 let avm1_root = start. avm1_root ( ) ;
27282704
27292705 if let Some ( object) =
2730- self . resolve_target_path ( avm1_root, * scope. locals ( ) , & path, false , true ) ?
2706+ self . resolve_target_path ( avm1_root, * scope. locals ( ) , & path, false ) ?
27312707 {
27322708 return Ok ( CallableValue :: UnCallable ( object. into ( ) ) ) ;
27332709 }
@@ -2793,7 +2769,7 @@ impl<'a, 'gc> Activation<'a, 'gc> {
27932769 let avm1_root = start. avm1_root ( ) ;
27942770
27952771 if let Some ( object) =
2796- self . resolve_target_path ( avm1_root, * scope. locals ( ) , path, true , true ) ?
2772+ self . resolve_target_path ( avm1_root, * scope. locals ( ) , path, true ) ?
27972773 {
27982774 let var_name = AvmString :: new ( self . gc ( ) , var_name) ;
27992775 object. set ( var_name, value, self ) ?;
@@ -3011,7 +2987,7 @@ impl<'a, 'gc> Activation<'a, 'gc> {
30112987 if target. is_empty ( ) {
30122988 new_target_clip = Some ( base_clip) ;
30132989 } else if let Some ( clip) = self
3014- . resolve_target_path ( root, start, target, false , true ) ?
2990+ . resolve_target_path ( root, start, target, false ) ?
30152991 . and_then ( |o| o. as_display_object ( ) )
30162992 . filter ( |_| !self . base_clip . avm1_removed ( ) )
30172993 // All properties invalid if base clip is removed.
0 commit comments