Function evaluate

  • Evaluate an AST node into a value.

    Parameters

    • node: any

      AST node to evaluate

    • Rest ...contexts: any[]

      Objects to look up identifiers in (in order). E.g. the first could be local data, the second could be global data.

    Returns any

Properties

Properties

evaluators: {
    ArrayExpression: ((node) => any);
    BinaryExpression: ((node, ...contexts) => any);
    CallExpression: ((node, ...contexts) => any);
    Compound: ((node, ...contexts) => any);
    ConditionalExpression: ((node, ...contexts) => any);
    Identifier: ((node, ...contexts) => any);
    Literal: ((node) => any);
    MemberExpression: ((node, ...contexts) => any);
    ThisExpression: ((node, ...contexts) => any);
    UnaryExpression: ((node, ...contexts) => any);
}

Type declaration

  • ArrayExpression: ((node) => any)
      • (node): any
      • Parameters

        • node: any

        Returns any

  • BinaryExpression: ((node, ...contexts) => any)
      • (node, ...contexts): any
      • Parameters

        • node: any
        • Rest ...contexts: any[]

        Returns any

  • CallExpression: ((node, ...contexts) => any)
      • (node, ...contexts): any
      • Parameters

        • node: any
        • Rest ...contexts: any[]

        Returns any

  • Compound: ((node, ...contexts) => any)
      • (node, ...contexts): any
      • Parameters

        • node: any
        • Rest ...contexts: any[]

        Returns any

  • ConditionalExpression: ((node, ...contexts) => any)
      • (node, ...contexts): any
      • Parameters

        • node: any
        • Rest ...contexts: any[]

        Returns any

  • Identifier: ((node, ...contexts) => any)
      • (node, ...contexts): any
      • Parameters

        • node: any
        • Rest ...contexts: any[]

        Returns any

  • Literal: ((node) => any)
      • (node): any
      • Parameters

        • node: any

        Returns any

  • MemberExpression: ((node, ...contexts) => any)
      • (node, ...contexts): any
      • Parameters

        • node: any
        • Rest ...contexts: any[]

        Returns any

  • ThisExpression: ((node, ...contexts) => any)
      • (node, ...contexts): any
      • Parameters

        • node: any
        • Rest ...contexts: any[]

        Returns any

  • UnaryExpression: ((node, ...contexts) => any)
      • (node, ...contexts): any
      • Parameters

        • node: any
        • Rest ...contexts: any[]

        Returns any

Generated using TypeDoc