diff --git a/javascript/extractor/src/com/semmle/js/extractor/AbstractDetector.java b/javascript/extractor/src/com/semmle/js/extractor/AbstractDetector.java index 2812772b7d41..8b1ed9cc5a68 100644 --- a/javascript/extractor/src/com/semmle/js/extractor/AbstractDetector.java +++ b/javascript/extractor/src/com/semmle/js/extractor/AbstractDetector.java @@ -12,6 +12,7 @@ import com.semmle.js.ast.Node; import com.semmle.js.ast.ParenthesizedExpression; import com.semmle.js.ast.Program; +import com.semmle.js.ast.SequenceExpression; import com.semmle.js.ast.Statement; import com.semmle.js.ast.TryStatement; import com.semmle.js.ast.UnaryExpression; @@ -88,6 +89,11 @@ protected boolean visitExpression(Expression e) { if (body instanceof BlockStatement) { return visitStatement((BlockStatement) body); } + } else if (e instanceof SequenceExpression) { + SequenceExpression seq = (SequenceExpression) e; + for (Expression child : seq.getExpressions()) { + if (visitExpression(child)) return true; + } } return false; } diff --git a/javascript/ql/test/library-tests/ModuleTypes/tests.expected b/javascript/ql/test/library-tests/ModuleTypes/tests.expected index 15332636c8fd..103a65951db0 100644 --- a/javascript/ql/test/library-tests/ModuleTypes/tests.expected +++ b/javascript/ql/test/library-tests/ModuleTypes/tests.expected @@ -8,4 +8,4 @@ | modulePackage/tst.js:1:1:1:75 | | es2015 | | require.js:1:1:7:1 | | node | | script.js:1:1:1:35 | | non-module | -| toplevel-comma.js:1:1:5:0 | | non-module | +| toplevel-comma.js:1:1:5:0 | | node |