Skip to content

Commit da5cd25

Browse files
Napalysasgerf
andcommitted
Update javascript/ql/src/LanguageFeatures/TemplateSyntaxInStringLiteral.ql
Co-Authored-By: Asger F <[email protected]>
1 parent 75ee649 commit da5cd25

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

javascript/ql/src/LanguageFeatures/TemplateSyntaxInStringLiteral.ql

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,8 @@ class CandidateStringLiteral extends StringLiteral {
7676
* ```
7777
*/
7878
predicate hasObjectProvidingTemplateVariables(CandidateStringLiteral lit) {
79-
exists(DataFlow::CallNode call, DataFlow::ObjectLiteralNode obj, DataFlow::Node stringArg |
80-
stringArg = [StringConcatenation::getRoot(lit.flow()), lit.flow()] and
81-
stringArg = call.getAnArgument() and
79+
exists(DataFlow::CallNode call, DataFlow::ObjectLiteralNode obj |
80+
call.getAnArgument() = [lit.flow(), StringConcatenation::getRoot(lit.flow())] and
8281
obj.flowsTo(call.getAnArgument()) and
8382
forex(string name | name = lit.getAReferencedVariable() | exists(obj.getAPropertyWrite(name)))
8483
)

0 commit comments

Comments
 (0)