@@ -604,9 +604,7 @@ impl<'a, 'gc, 'gc_context> Activation<'a, 'gc, 'gc_context> {
604604 let a = self . context . avm1 . pop ( ) ;
605605 let b = self . context . avm1 . pop ( ) ;
606606 let result = b. as_bool ( self . swf_version ( ) ) && a. as_bool ( self . swf_version ( ) ) ;
607- self . context
608- . avm1
609- . push ( Value :: from_bool ( result, self . swf_version ( ) ) ) ;
607+ self . context . avm1 . push ( result. into ( ) ) ; // Diverges from spec: returns a boolean even in SWF 4
610608 Ok ( FrameControl :: Continue )
611609 }
612610
@@ -949,8 +947,8 @@ impl<'a, 'gc, 'gc_context> Activation<'a, 'gc, 'gc_context> {
949947 let name_val = self . context . avm1 . pop ( ) ;
950948 let name = name_val. coerce_to_string ( self ) ?;
951949
952- //Fun fact: This isn't in the Adobe SWF19 spec, but this opcode returns
953- //a boolean based on if the delete actually deleted something.
950+ // Fun fact: This isn't in the Adobe SWF19 spec, but this opcode returns
951+ // a boolean based on if the delete actually deleted something.
954952 let success = self . scope_cell ( ) . read ( ) . delete ( self , name) ;
955953 self . context . avm1 . push ( success. into ( ) ) ;
956954
@@ -1024,9 +1022,7 @@ impl<'a, 'gc, 'gc_context> Activation<'a, 'gc, 'gc_context> {
10241022 let a = self . context . avm1 . pop ( ) . coerce_to_f64 ( self ) ?;
10251023 let b = self . context . avm1 . pop ( ) . coerce_to_f64 ( self ) ?;
10261024 let result = b == a;
1027- self . context
1028- . avm1
1029- . push ( Value :: from_bool ( result, self . swf_version ( ) ) ) ;
1025+ self . context . avm1 . push ( result. into ( ) ) ; // Diverges from spec: returns a boolean even in SWF 4
10301026 Ok ( FrameControl :: Continue )
10311027 }
10321028
@@ -1490,9 +1486,7 @@ impl<'a, 'gc, 'gc_context> Activation<'a, 'gc, 'gc_context> {
14901486 let a = self . context . avm1 . pop ( ) ;
14911487 let b = self . context . avm1 . pop ( ) ;
14921488 let result = b. coerce_to_f64 ( self ) ? < a. coerce_to_f64 ( self ) ?;
1493- self . context
1494- . avm1
1495- . push ( Value :: from_bool ( result, self . swf_version ( ) ) ) ;
1489+ self . context . avm1 . push ( result. into ( ) ) ; // Diverges from spec: returns a boolean even in SWF 4
14961490 Ok ( FrameControl :: Continue )
14971491 }
14981492
@@ -1603,9 +1597,7 @@ impl<'a, 'gc, 'gc_context> Activation<'a, 'gc, 'gc_context> {
16031597 fn action_not ( & mut self ) -> Result < FrameControl < ' gc > , Error < ' gc > > {
16041598 let a = self . context . avm1 . pop ( ) ;
16051599 let result = !a. as_bool ( self . swf_version ( ) ) ;
1606- self . context
1607- . avm1
1608- . push ( Value :: from_bool ( result, self . swf_version ( ) ) ) ;
1600+ self . context . avm1 . push ( result. into ( ) ) ; // Diverges from spec: returns a boolean even in SWF 4
16091601 Ok ( FrameControl :: Continue )
16101602 }
16111603
@@ -1692,9 +1684,7 @@ impl<'a, 'gc, 'gc_context> Activation<'a, 'gc, 'gc_context> {
16921684 let a = self . context . avm1 . pop ( ) ;
16931685 let b = self . context . avm1 . pop ( ) ;
16941686 let result = b. as_bool ( self . swf_version ( ) ) || a. as_bool ( self . swf_version ( ) ) ;
1695- self . context
1696- . avm1
1697- . push ( Value :: from_bool ( result, self . swf_version ( ) ) ) ;
1687+ self . context . avm1 . push ( result. into ( ) ) ; // Diverges from spec: returns a boolean even in SWF 4
16981688 Ok ( FrameControl :: Continue )
16991689 }
17001690
@@ -1979,9 +1969,7 @@ impl<'a, 'gc, 'gc_context> Activation<'a, 'gc, 'gc_context> {
19791969 let a = self . context . avm1 . pop ( ) ;
19801970 let b = self . context . avm1 . pop ( ) ;
19811971 let result = b. coerce_to_string ( self ) ? == a. coerce_to_string ( self ) ?;
1982- self . context
1983- . avm1
1984- . push ( Value :: from_bool ( result, self . swf_version ( ) ) ) ;
1972+ self . context . avm1 . push ( result. into ( ) ) ; // Diverges from spec: returns a boolean even in SWF 4
19851973 Ok ( FrameControl :: Continue )
19861974 }
19871975
@@ -2014,9 +2002,7 @@ impl<'a, 'gc, 'gc_context> Activation<'a, 'gc, 'gc_context> {
20142002 let a = self . context . avm1 . pop ( ) ;
20152003 let b = self . context . avm1 . pop ( ) ;
20162004 let result = b. coerce_to_string ( self ) ?. gt ( & a. coerce_to_string ( self ) ?) ;
2017- self . context
2018- . avm1
2019- . push ( Value :: from_bool ( result, self . swf_version ( ) ) ) ;
2005+ self . context . avm1 . push ( result. into ( ) ) ;
20202006 Ok ( FrameControl :: Continue )
20212007 }
20222008
@@ -2034,9 +2020,7 @@ impl<'a, 'gc, 'gc_context> Activation<'a, 'gc, 'gc_context> {
20342020 let a = self . context . avm1 . pop ( ) ;
20352021 let b = self . context . avm1 . pop ( ) ;
20362022 let result = b. coerce_to_string ( self ) ?. lt ( & a. coerce_to_string ( self ) ?) ;
2037- self . context
2038- . avm1
2039- . push ( Value :: from_bool ( result, self . swf_version ( ) ) ) ;
2023+ self . context . avm1 . push ( result. into ( ) ) ; // Diverges from spec: returns a boolean even in SWF 4
20402024 Ok ( FrameControl :: Continue )
20412025 }
20422026
0 commit comments