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
24 lines (17 loc) · 803 Bytes
/
Errors.qll
File metadata and controls
24 lines (17 loc) · 803 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
/** 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() }
}
/** A JavaScript parse error encountered during extraction. */
class JSParseError extends @js_parse_error, Error {
/** Gets the toplevel element this error occurs in. */
TopLevel getTopLevel() { jsParseErrors(this, result, _, _) }
override string getMessage() { jsParseErrors(this, _, result, _) }
/** Gets the source text of the line this error occurs on. */
string getLine() { jsParseErrors(this, _, _, result) }
}