constructor({id, origin, upper, onLooped}) {
    /**
     * The identifier of this code path.
     * Rules use it to store additional information of each rule.
     * @type {string}
     */
    this.id = id;

    /**
     * The reason that this code path was started. May be "program",
     * "function", "class-field-initializer", or "class-static-block".
     * @type {string}
     */
    this.origin = origin;

    /**
     * The code path of the upper function scope.
     * @type {CodePath|null}
     */
    this.upper = upper;

    /**
     * The code paths of nested function scopes.
     * @type {CodePath[]}
     */
    this.childCodePaths = [];

    // Initializes internal state.
    Object.defineProperty(this, 'internal', {
      value: new CodePathState(new IdGenerator(`${id}_`), onLooped),
    });

    // Adds this into `childCodePaths` of `upper`.
    if (upper) {
      upper.childCodePaths.push(this);
    }
  }
Creates a new instance.
@param {Object} options Options for the function (see below).
@param {string} options.id An identifier.
@param {string} options.origin The type of code path origin.
@param {CodePath|null} options.upper The code path of the upper function scope.
@param {Function} options.onLooped A callback function to notify looping.