Skip to content

Errors

Errors contains a list of parsing or diagnostic errors.

new Errors(source?, errors?, numErrors?, maxErrors?): Errors

Source

CommonError[] = []

number = errors.length

number = 100

Errors

readonly maxErrorsToReport: number

MaxErrorsToReport bounds the number of emitted display lines.

append(errs): Errors

Append creates a new Errors object with the current and input errors.

CommonError[]

Errors


getErrors(): CommonError[]

GetErrors returns the list of observed errors.

CommonError[]


reportError(location, format, …args): void

ReportError records an error at a source location.

Location

string

…unknown[]

void


reportErrorAtId(exprId, location, format, …args): void

ReportErrorAtId records an error at a source location and expression id.

number

Location

string

…unknown[]

void


reportErrorString(location, message): void

ReportErrorString records an already formatted error at a source location.

Location

string

void


toDisplayString(): string

ToDisplayString returns the error set as a newline-delimited string.

string