mirror of
https://github.com/github/codeql.git
synced 2026-04-29 10:45:15 +02:00
Merge pull request #3441 from erik-krogh/BabelDirectives
Approved by esbena
This commit is contained in:
@@ -16,5 +16,7 @@ where
|
||||
// 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
|
||||
not d.getParent() instanceof CodeInAttribute and
|
||||
// exclude babel generated directives like "@babel/helpers - typeof".
|
||||
not d.getDirectiveText().prefix(14) = "@babel/helpers"
|
||||
select d, "Unknown directive: '" + truncate(d.getDirectiveText(), 20, " ... (truncated)") + "'."
|
||||
|
||||
@@ -45,3 +45,7 @@ function yui() {
|
||||
":nomunge"; // NOT OK
|
||||
"foo(), bar, baz:nomunge"; // NOT OK
|
||||
}
|
||||
|
||||
function babel_typeof(obj) {
|
||||
"@babel/helpers - typeof"
|
||||
}
|
||||
Reference in New Issue
Block a user