forked from github/codeql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathErrors.qll
More file actions
29 lines (20 loc) · 1004 Bytes
/
Copy pathErrors.qll
File metadata and controls
29 lines (20 loc) · 1004 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/** Provides classes for working with syntax errors. */
import javascript
/** An error encountered during extraction. */
abstract class Error extends Locatable {
override Location getLocation() { hasLocation(this, result) }
/** Gets the message associated with this error. */
abstract string getMessage();
override string toString() { result = getMessage() }
/** Holds if this error prevented the file from being extracted. */
predicate isFatal() { any() }
}
/** A JavaScript parse error encountered during extraction. */
class JSParseError extends @js_parse_error, Error {
/** Gets the toplevel element this error occurs in. */
TopLevel getTopLevel() { js_parse_errors(this, result, _, _) }
override string getMessage() { js_parse_errors(this, _, result, _) }
/** Gets the source text of the line this error occurs on. */
string getLine() { js_parse_errors(this, _, _, result) }
override predicate isFatal() { not getTopLevel() instanceof Angular2::TemplateTopLevel }
}