Merge pull request #2235 from max-schaefer/js/issue-2233

Approved by esbena
This commit is contained in:
semmle-qlci
2019-10-31 14:17:58 +00:00
committed by GitHub
3 changed files with 7 additions and 0 deletions

View File

@@ -13,6 +13,8 @@ import javascript
from Directive d
where
not d instanceof KnownDirective and
// ignore ":" pseudo-directive sometimes seen in dual-use shell/node.js scripts
not d.getExpr().getStringValue() = ":" and
// but exclude attribute top-levels: `<a href="javascript:'some-attribute-string'">`
not d.getParent() instanceof CodeInAttribute
select d, "Unknown directive: '" + truncate(d.getDirectiveText(), 20, " ... (truncated)") + "'."

View File

@@ -0,0 +1,4 @@
#!/bin/sh
":" //# ; exec /usr/bin/env node "$0" "$@"
console.log('javascript');