mirror of
https://github.com/github/codeql.git
synced 2026-05-01 03:35:13 +02:00
JS: truncate js/unknown-directive message content
This commit is contained in:
@@ -14,4 +14,4 @@ from Directive d
|
||||
where not d instanceof KnownDirective and
|
||||
// but exclude attribute top-levels: `<a href="javascript:'some-attribute-string'">`
|
||||
not (d.getParent() instanceof CodeInAttribute)
|
||||
select d, "Unknown directive: '" + d.getDirectiveText() + "'."
|
||||
select d, "Unknown directive: '" + truncate(d.getDirectiveText(), 20, " ... (truncated)") + "'."
|
||||
|
||||
@@ -11,3 +11,5 @@
|
||||
| UnknownDirective.js:12:5:12:17 | "use struct;" | Unknown directive: 'use struct;'. |
|
||||
| UnknownDirective.js:13:5:13:17 | "Use Strict"; | Unknown directive: 'Use Strict'. |
|
||||
| UnknownDirective.js:14:5:14:14 | "use bar"; | Unknown directive: 'use bar'. |
|
||||
| UnknownDirective.js:38:5:38:17 | "[0, 0, 0];"; | Unknown directive: '[0, 0, 0];'. |
|
||||
| UnknownDirective.js:39:5:39:65 | "[0, 0, ... , 0];"; | Unknown directive: '[0, 0, 0, 0, 0, 0, 0 ... (truncated)'. |
|
||||
|
||||
@@ -33,3 +33,8 @@ function good() {
|
||||
"deps foo"; // OK
|
||||
"deps bar"; // OK
|
||||
}
|
||||
|
||||
function data() {
|
||||
"[0, 0, 0];"; // NOT OK
|
||||
"[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];"; // NOT OK
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user