@@ -1072,7 +1072,11 @@ module NodeJSLib {
10721072 )
10731073 or
10741074 node instanceof ReadableFromCall and
1075- tag = "nodejs.readable.from.chunk"
1075+ tag =
1076+ [
1077+ "nodejs.readable.from.chunk" , "nodejs.readable.from.map-key" ,
1078+ "nodejs.readable.from.map-value"
1079+ ]
10761080 ) and
10771081 container .asSourceCallable ( ) = node .getContainer ( )
10781082 }
@@ -1105,14 +1109,19 @@ module NodeJSLib {
11051109 override predicate readStep (
11061110 DataFlow:: Node pred , DataFlow:: ContentSet contents , DataFlow:: Node succ
11071111 ) {
1108- exists ( ReadableFromCall call |
1109- pred = call .getArgument ( 0 ) .flow ( ) and
1112+ exists ( ReadableFromCall call | pred = call .getArgument ( 0 ) .flow ( ) |
11101113 contents =
11111114 [
11121115 DataFlow:: ContentSet:: arrayElement ( ) , DataFlow:: ContentSet:: setElement ( ) ,
11131116 DataFlow:: ContentSet:: iteratorElement ( )
11141117 ] and
11151118 succ = getSynthesizedNode ( call , "nodejs.readable.from.chunk" )
1119+ or
1120+ contents = DataFlow:: ContentSet:: mapKey ( ) and
1121+ succ = getSynthesizedNode ( call , "nodejs.readable.from.map-key" )
1122+ or
1123+ contents = DataFlow:: ContentSet:: mapValueAll ( ) and
1124+ succ = getSynthesizedNode ( call , "nodejs.readable.from.map-value" )
11161125 )
11171126 or
11181127 exists ( PipeCall call |
@@ -1131,6 +1140,16 @@ module NodeJSLib {
11311140 succ = call .flow ( )
11321141 )
11331142 or
1143+ exists ( ReadableFromCall call |
1144+ pred = getSynthesizedNode ( call , "nodejs.readable.from.map-key" ) and
1145+ contents .asSingleton ( ) .asArrayIndex ( ) = 0
1146+ or
1147+ pred = getSynthesizedNode ( call , "nodejs.readable.from.map-value" ) and
1148+ contents .asSingleton ( ) .asArrayIndex ( ) = 1
1149+ |
1150+ succ = getSynthesizedNode ( call , "nodejs.readable.from.chunk" )
1151+ )
1152+ or
11341153 exists ( PipeHookCall hook , DataFlow:: CallNode callback |
11351154 callback = pipeTransformCallback ( hook , DataFlow:: TypeTracker:: end ( ) ) .getACall ( ) and
11361155 pred = callback .getArgument ( 1 ) and
0 commit comments