Class: CompilerError

CompilerError(code, …args)

Base error class for all compiler-related errors and warnings in Avenx-JS. Subclasses AvenxError to maintain compatibility with standard error handling.

Constructor

new CompilerError(code, …args)

Creates an instance of CompilerError.

Parameters:
Name Type Attributes Description
code string

The AvenxErrorCode identifier.

args any <repeatable>

Arguments to format within the template message, optionally ending with a location options object.

Source:

Extends

Classes

CompilerError

Members

code :string

The unique framework error code.

Type:
  • string
Overrides:
Source:

name :string

Custom name identifier for compiler errors.

Type:
  • string
Overrides:
Source:

Methods

setLocation(loc) → {CompilerError}

Attaches source location information and generates a code frame with carets (^).

Parameters:
Name Type Description
loc object

Location options object containing { line, column, source, filename, index, length }.

Source:
Returns:

Returns this error instance for chaining.

Type
CompilerError

(static) formatCodeFrame(source, line, column, optionsopt) → {string}

Helper static method to format code frames.

Parameters:
Name Type Attributes Description
source string
line number
column number
options object <optional>
Source:
Returns:
Type
string

(static) getLineAndColumn(source, index) → {Object}

Helper static method to compute line and column coordinates.

Parameters:
Name Type Description
source string
index number
Source:
Returns:
Type
Object