Ibyar/Aurora
    Preparing search index...

    Class Identifier

    An identifier is a sequence of characters in the code that identifies a variable, function, or property. In JavaScript, identifiers are case-sensitive and can contain Unicode letters, $, _, and digits (0-9), but may not start with a digit. An identifier differs from a string in that a string is data, while an identifier is part of the code. In JavaScript, there is no way to convert identifiers to strings, but sometimes it is possible to parse strings into identifiers.

    Hierarchy (View Summary)

    Implements

    Index

    The loc field represents the source location information of the node. If the node contains no information about the source location, the field is null or undefined; otherwise it is an object consisting of a start position (the position of the first character of the parsed source region) and an end position (the position of the first character after the parsed source region): and offset index (the position of the first character)

    name: string | number
    range?: [number, number]

    start and end position offset

    type: string

    The type field is a string representing the AST variant type. Each subtype of Node is documented below with the specific string of its type field. You can use this field to determine which interface a node implements.

    • declare variable in the current local scope (block), or closest function scope (global) scop, the propertyName will be calculated at runtime

      Parameters

      • stack: Stack

        the stack which an identifier will be declared

      • propertyValue: any

        the initial value of identifier

      Returns any

    • get all dependencies form an expression node

      the return from this method, is represent an answer for what identifiers this expression depends-on.

      ex:

      x + y;
      
      • for + operator : the answer should be lhs and rhs,
      • for x identifier: the answer should be node x,
      • for y identifier: the answer should be node y.

      so, the return from + will be [ node 'x', node 'y']

      and:

      • x.y.z * a ==> [ member node x.y.z, identifier 'a']

      Parameters

      • Optionalcomputed: true

      Returns ExpressionNode[]

    • ex:

      x + y;
      
      • for + operator : the answer should be lhs and rhs,
      • for x identifier: the answer should be node x,
      • for y identifier: the answer should be node y.

      so, the return from + will be ['x', 'y']

      and:

      • x.y.z ==> ['x', 'y', 'z']
      • x[y].z ==> ['x', ]

      Parameters

      • Optionalcomputed: true

        required for member and chaining operators

      Returns ExpressionEventPath[]

    • get all the events form this expression

      the return from this method, is represent an answer for what is this expression depends-on as identifier name

      ex:

      x + y;
      
      • for + operator : the answer should be lhs and rhs,
      • for x identifier: the answer should be x
      • for y identifier: the answer should be y the final output will be

      so, the return from + will be { x: undefined, y: undefined }

      and:

      • x.y.z * a ==> { x: { y: { z: undefined }, a: undefined } }
      • x.y.z > x.y.h.g ==> { x: { y: { z: undefined, h: { g: undefined} } } }
      • x[Symbol.toStringTag] + 'Class' + classType + array[3] ==> { x: { 'Symbol.toStringTag': undefined }, classType: undefined, array: { 3: undefined } }
      • 'name' ==> {}
      • 
        

      user[firstName + son of ${fatherName}] ``` ==> { user: { 'firstName:fatherName': undefined }, firstName: undefined, fatherName: undefined }

      Returns ExpressionEventMap

    • try to search for scope of this expression

      Type Parameters

      • T extends object

      Parameters

      Returns Scope<T>

    • Type Parameters

      • T extends object

      Parameters

      Returns Scope<T>

    • execute/get the code for this expression and return the result value.

      Parameters

      • stack: Stack
      • OptionalthisContext: any

      Returns any

    • get the variable declaration name

      Returns string

    • Returns string | number

    • assign the value to this expression in stack.

      most ExpressionNode will not implement this method, and will throw an exception.

      Parameters

      Returns any

    • Returns object