Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bf2c944 commit b4df037Copy full SHA for b4df037
2 files changed
javascript/ql/src/semmle/javascript/StringConcatenation.qll
@@ -55,6 +55,13 @@ module StringConcatenation {
55
exists(DataFlow::MethodCallNode call |
56
node = call and
57
call.getMethodName() = "concat" and
58
+ not (
59
+ exists(DataFlow::ArrayCreationNode array |
60
+ array.flowsTo(call.getAnArgument()) or array.flowsTo(call.getReceiver())
61
+ )
62
+ or
63
+ DataFlow::reflectiveCallNode(_) = call
64
+ ) and
65
(
66
n = 0 and
67
result = call.getReceiver()
javascript/ql/test/library-tests/StringConcatenation/tst.js
@@ -95,3 +95,7 @@ function concatCall() {
95
x = x.concat('two', 'three');
96
return x;
97
}
98
+
99
+function arrayConcat(a, b) {
100
+ return [].concat(a, b);
101
+}
0 commit comments