Skip to content

Commit 7fb8f84

Browse files
committed
fix for when the concatenation root is in parentheses
1 parent 69365cc commit 7fb8f84

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

javascript/ql/src/Expressions/MissingSpaceInAppend.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Expr leftChild(Expr e) {
2323
}
2424

2525
predicate isInConcat(Expr e) {
26-
exists(ParExpr par | par.getExpression() = e)
26+
exists(ParExpr par | isInConcat(par) and par.getExpression() = e)
2727
or
2828
exists(AddExpr a | a.getAnOperand() = e)
2929
}

javascript/ql/test/query-tests/Expressions/MissingSpaceInAppend/MissingSpaceInAppend.expected

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@
1111
| missing.js:24:5:24:21 | `missing a space` | This string appears to be missing a space after 'space'. |
1212
| missing.js:26:5:26:21 | "missing a space" | This string appears to be missing a space after 'space'. |
1313
| missing.js:28:5:28:21 | `missing a space` | This string appears to be missing a space after 'space'. |
14-
| missing.js:31:7:31:12 | "h. 0" | This string appears to be missing a space after '0'. |
14+
| missing.js:30:7:30:21 | "missing space" | This string appears to be missing a space after 'space'. |
15+
| missing.js:32:7:32:12 | "h. 0" | This string appears to be missing a space after '0'. |

javascript/ql/test/query-tests/Expressions/MissingSpaceInAppend/missing.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@ s = "missing a space" +
2727
`here`;
2828
s = `missing a space` +
2929
`here`;
30+
s = (("missing space") + "here")
3031

3132
s = (("h. 0" + "h")) + "word"

0 commit comments

Comments
 (0)