File tree Expand file tree Collapse file tree
javascript/ql/lib/semmle/javascript/internal/flow_summaries Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11/**
2- * Contains a summary for relevant methods on arrays, except Array.prototype.join which is currently special-cased in StringConcatenation.qll .
2+ * Contains a summary for relevant methods on arrays.
33 *
4- * Note that some of Array methods are modelled in `AmbiguousCoreMethods.qll`, and `join` and ` toString` are special-cased elsewhere.
4+ * Note that some of Array methods are modelled in `AmbiguousCoreMethods.qll`, and `toString` is special-cased elsewhere.
55 */
66
77private import javascript
@@ -116,6 +116,26 @@ class ArrayConstructorSummary extends SummarizedCallable {
116116 }
117117}
118118
119+ /**
120+ * A call to `join` with a separator argument.
121+ *
122+ * Calls without separators are modelled in `StringConcatenation.qll`.
123+ */
124+ class Join extends SummarizedCallable {
125+ Join ( ) { this = "Array#join" }
126+
127+ override InstanceCall getACallSimple ( ) {
128+ result .getMethodName ( ) = "join" and
129+ result .getNumArgument ( ) = [ 0 , 1 ]
130+ }
131+
132+ override predicate propagatesFlowExt ( string input , string output , boolean preservesValue ) {
133+ preservesValue = false and
134+ input = "Argument[this].ArrayElement" and
135+ output = "ReturnValue"
136+ }
137+ }
138+
119139class CopyWithin extends SummarizedCallable {
120140 CopyWithin ( ) { this = "Array#copyWithin" }
121141
You can’t perform that action at this time.
0 commit comments