@@ -408,11 +408,14 @@ class QAST::OperationsJS {
408
408
409
409
if $ type != $ T_OBJ {
410
410
add_simple_op(' bindpos' ~ $ suffix , $ type , [$ T_OBJ , $ T_INT , $ type ], sub ($ list , $ index , $ value ) {" $ list .\$\$bindpos($ index , $ value )" }, : sideffects);
411
- add_simple_op(' pop' ~ $ suffix , $ type , [$ T_OBJ ], sub ($ array ) {" $ array .\$\$pop()" }, : sideffects);
412
- add_simple_op(' push' ~ $ suffix , $ type , [$ T_OBJ , $ type ], sub ($ array , $ elem ) {" $ array .\$\$push($ elem )" }, : sideffects);
413
411
add_simple_op(' atpos' ~ $ suffix , $ type , [$ T_OBJ , $ T_INT ], sub ($ list , $ index ) {" $ list .\$\$atpos$ suffix($ index )" });
414
412
415
413
}
414
+
415
+ add_simple_op(' pop' ~ $ suffix , $ type , [$ T_OBJ ], sub ($ array ) {" $ array .\$\$pop()" }, : sideffects);
416
+ add_simple_op(' push' ~ $ suffix , $ type , [$ T_OBJ , $ type ], sub ($ array , $ elem ) {" $ array .\$\$push($ elem )" }, : sideffects);
417
+ add_simple_op(' unshift' ~ $ suffix , $ type , [$ T_OBJ , $ type ], sub ($ array , $ elem ) {" $ array .\$\$unshift($ elem )" }, : sideffects);
418
+ add_simple_op(' shift' ~ $ suffix , $ type , [$ T_OBJ ], sub ($ array ) {" $ array .\$\$shift()" }, : sideffects);
416
419
417
420
418
421
add_simple_op(' atposnd' ~ $ suffix , $ type , [$ T_OBJ , $ T_OBJ ]);
@@ -723,12 +726,6 @@ class QAST::OperationsJS {
723
726
Chunk. new ($ T_OBJ , " new nqp.CurLexpad(\{ { nqp :: join (' ,' , @ get )} \} , \{ { nqp :: join (' ,' , @ set )} \} )" , [], : $ node );
724
727
});
725
728
726
-
727
- add_simple_op(' shift' , $ T_OBJ , [$ T_OBJ ], : sideffects);
728
- add_simple_op(' unshift' , $ T_OBJ , [$ T_OBJ , $ T_OBJ ], : sideffects);
729
- add_simple_op(' pop' , $ T_OBJ , [$ T_OBJ ], : sideffects);
730
- add_simple_op(' push' , $ T_OBJ , [$ T_OBJ , $ T_OBJ ], : sideffects);
731
-
732
729
add_simple_op(' splice' , $ T_OBJ , [$ T_OBJ , $ T_OBJ , $ T_INT , $ T_INT ], : sideffects);
733
730
734
731
add_simple_op(' setelems' , $ T_OBJ , [$ T_OBJ , $ T_INT ], : sideffects);
@@ -990,7 +987,7 @@ class QAST::OperationsJS {
990
987
my $ arity := @ operands [1 ]. arity || 1 ;
991
988
while $ arity > 0 {
992
989
my $ iterval := $ * BLOCK . add_tmp();
993
- @ body_args . push (Chunk. new ($ T_OBJ , $ iterval , [" $ iterval = $ iterator. shift () ;\n " ]));
990
+ @ body_args . push (Chunk. new ($ T_OBJ , $ iterval , [" $ iterval = $ iterator .\$\$ shift();\n " ]));
994
991
$ arity := $ arity - 1 ;
995
992
}
996
993
0 commit comments