File tree Expand file tree Collapse file tree
lib/semmle/javascript/dataflow/internal
test/library-tests/FlowSummary Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -252,7 +252,10 @@ ArgumentPosition decodeUnknownArgumentPosition(AccessPathSyntax::AccessPathToken
252252 * `encodeContent` predicate.
253253 */
254254bindingset [ token]
255- ContentSet decodeUnknownContent ( AccessPathSyntax:: AccessPathTokenBase token ) { none ( ) }
255+ ContentSet decodeUnknownContent ( AccessPathSyntax:: AccessPathTokenBase token ) {
256+ token .getName ( ) = "Member" and
257+ result .asPropertyName ( ) = token .getAnArgument ( )
258+ }
256259
257260/**
258261 * Gets a return kind corresponding to the unknown token `token`.
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ postIsInSameCallable
1818reverseRead
1919| tst.js:109:11:113:3 | [dynamic parameter array] | Origin of readStep is missing a PostUpdateNode. |
2020| tst.js:267:28:267:31 | map3 | Origin of readStep is missing a PostUpdateNode. |
21+ | tst.js:305:30:305:43 | constructedMap | Origin of readStep is missing a PostUpdateNode. |
2122argHasPostUpdate
2223postWithInFlow
2324viableImplInCallContextTooLarge
Original file line number Diff line number Diff line change @@ -299,3 +299,11 @@ function m18() {
299299 sink ( dynamicParam1 ( "safe" , ...[ source ( ) ] ) ) ; // NOT OK
300300 sink ( dynamicParam1 ( source ( ) , ...[ "safe" ] ) ) ; // OK
301301}
302+
303+ function m19 ( ) {
304+ const constructedMap = new Map ( [ [ "key" , source ( ) ] ] ) ;
305+ for ( const [ key , value ] of constructedMap ) {
306+ sink ( key ) ; // OK
307+ sink ( value ) ; // NOT OK
308+ }
309+ }
You can’t perform that action at this time.
0 commit comments