Class: ContractValidator

ContractValidator()

ContractValidator validates semantic guarantees declared via compiler contracts:

  • 'static': output never changes; zero dynamic interpolations or reactive bindings.
  • 'pure': zero observable side-effects during evaluation.
  • 'deterministic': identical inputs yield identical output; no Math.random/Date.now.
  • 'isolated': strict dependency boundary; depends only on props/local state, no $bridges/$parent.

Constructor

new ContractValidator()

Source:

Methods

(static) validate(nodes, metadata) → {object}

Validates all declared contracts on a component and its template AST.

Parameters:
Name Type Description
nodes Array:.<object:>

Root AST nodes of template.

metadata object

Component metadata.

Properties
Name Type Attributes Description
name string <optional>

Component name.

filePath string <optional>

Absolute path to component file.

contracts Set:.<string:> <optional>

Component-level contracts.

state object <optional>

State object.

computed object <optional>

Computed property expressions.

methods object <optional>

Action method bodies.

resources object <optional>

Resources.

config object <optional>

Compiler config.

Source:
Returns:

Validation result { valid: boolean, errors: Error[], warnings: Error[] }

Type
object