@@ -5,6 +5,10 @@ const modes = [
55 new AsyncLogicEngine ( undefined , { disableInterpretedOptimization : true } )
66]
77
8+ for ( const engine of modes ) {
9+ engine . addMethod ( 'as1' , async ( n ) => n + 1 , { async : true , deterministic : true } )
10+ }
11+
812modes . forEach ( ( logic ) => {
913 describe ( '+' , ( ) => {
1014 test ( 'it should be able to add two numbers together' , async ( ) => {
@@ -867,5 +871,23 @@ modes.forEach((logic) => {
867871 await logic . run ( [ { test : true } , { test : true } ] )
868872 ) . toStrictEqual ( [ '1337' , '1337' ] )
869873 } )
874+
875+ test ( 'async + map + deterministic (trying to trigger avoidInlineAsync)' , async ( ) => {
876+ expect (
877+ await ( await logic . build ( {
878+ map : [ { var : 'arr' } , {
879+ map : [ [ 1 , 2 , 3 ] , { as1 : { var : '' } } ]
880+ } ]
881+ } ) ) ( { arr : [ 1 , 2 , 3 ] } )
882+ ) . toStrictEqual ( [ [ 2 , 3 , 4 ] , [ 2 , 3 , 4 ] , [ 2 , 3 , 4 ] ] )
883+
884+ expect (
885+ await logic . run ( {
886+ map : [ { var : 'arr' } , {
887+ map : [ [ 1 , 2 , 3 ] , { as1 : { var : '' } } ]
888+ } ]
889+ } , { arr : [ 1 , 2 , 3 ] } )
890+ ) . toStrictEqual ( [ [ 2 , 3 , 4 ] , [ 2 , 3 , 4 ] , [ 2 , 3 , 4 ] ] )
891+ } )
870892 } )
871893} )
0 commit comments