Errors
Errors contains a list of parsing or diagnostic errors.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Errors(
source?,errors?,numErrors?,maxErrors?):Errors
Parameters
Section titled “Parameters”source?
Section titled “source?”errors?
Section titled “errors?”CommonError[] = []
numErrors?
Section titled “numErrors?”number = errors.length
maxErrors?
Section titled “maxErrors?”number = 100
Returns
Section titled “Returns”Errors
Properties
Section titled “Properties”maxErrorsToReport
Section titled “maxErrorsToReport”
readonlymaxErrorsToReport:number
MaxErrorsToReport bounds the number of emitted display lines.
Methods
Section titled “Methods”append()
Section titled “append()”append(
errs):Errors
Append creates a new Errors object with the current and input errors.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Errors
getErrors()
Section titled “getErrors()”getErrors():
CommonError[]
GetErrors returns the list of observed errors.
Returns
Section titled “Returns”reportError()
Section titled “reportError()”reportError(
location,format, …args):void
ReportError records an error at a source location.
Parameters
Section titled “Parameters”location
Section titled “location”format
Section titled “format”string
…unknown[]
Returns
Section titled “Returns”void
reportErrorAtId()
Section titled “reportErrorAtId()”reportErrorAtId(
exprId,location,format, …args):void
ReportErrorAtId records an error at a source location and expression id.
Parameters
Section titled “Parameters”exprId
Section titled “exprId”number
location
Section titled “location”format
Section titled “format”string
…unknown[]
Returns
Section titled “Returns”void
reportErrorString()
Section titled “reportErrorString()”reportErrorString(
location,message):void
ReportErrorString records an already formatted error at a source location.
Parameters
Section titled “Parameters”location
Section titled “location”message
Section titled “message”string
Returns
Section titled “Returns”void
toDisplayString()
Section titled “toDisplayString()”toDisplayString():
string
ToDisplayString returns the error set as a newline-delimited string.
Returns
Section titled “Returns”string