@@ -5,6 +5,10 @@ const modes = [
5
5
new AsyncLogicEngine ( undefined , { disableInterpretedOptimization : true } )
6
6
]
7
7
8
+ for ( const engine of modes ) {
9
+ engine . addMethod ( 'as1' , async ( n ) => n + 1 , { async : true , deterministic : true } )
10
+ }
11
+
8
12
modes . forEach ( ( logic ) => {
9
13
describe ( '+' , ( ) => {
10
14
test ( 'it should be able to add two numbers together' , async ( ) => {
@@ -867,5 +871,23 @@ modes.forEach((logic) => {
867
871
await logic . run ( [ { test : true } , { test : true } ] )
868
872
) . toStrictEqual ( [ '1337' , '1337' ] )
869
873
} )
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
+ } )
870
892
} )
871
893
} )
0 commit comments