File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
lib/semmle/javascript/internal/flow_summaries
test/library-tests/TripleDot Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -157,7 +157,11 @@ class Values extends SummarizedCallable {
157
157
class ToString extends SummarizedCallable {
158
158
ToString ( ) { this = "Object#toString / Array#toString" }
159
159
160
- override DataFlow:: MethodCallNode getACallSimple ( ) { result .getMethodName ( ) = "toString" }
160
+ override InstanceCall getACallSimple ( ) {
161
+ result .( DataFlow:: MethodCallNode ) .getMethodName ( ) = "toString"
162
+ or
163
+ result = arrayConstructorRef ( ) .getAPropertyRead ( "prototype" ) .getAMemberCall ( "toString" )
164
+ }
161
165
162
166
override predicate propagatesFlow ( string input , string output , boolean preservesValue ) {
163
167
preservesValue = false and
Original file line number Diff line number Diff line change @@ -41,5 +41,5 @@ function implicitToString() {
41
41
sink ( array . toString ( ) ) ; // $ hasTaintFlow=implicitToString.1 hasTaintFlow=implicitToString.2
42
42
sink ( array . toString ( "utf8" ) ) ; // $ hasTaintFlow=implicitToString.1 hasTaintFlow=implicitToString.2
43
43
44
- sink ( Array . prototype . toString . call ( array ) ) ; // $ MISSING: hasTaintFlow=implicitToString.1 hasTaintFlow=implicitToString.2
44
+ sink ( Array . prototype . toString . call ( array ) ) ; // $ hasTaintFlow=implicitToString.1 hasTaintFlow=implicitToString.2
45
45
}
You can’t perform that action at this time.
0 commit comments