initialize method

void initialize()

Initialize this variable with its declared initializer bytecode

Implementation

void initialize() {
  if (definitionIp != null) {
    if (!_isInitializing) {
      _isInitializing = true;
      final initVal = interpreter.execute(
        context: HTContext(
          filename: fileName,
          moduleName: moduleName,
          ip: definitionIp!,
          namespace: closure,
          line: definitionLine,
          column: definitionColumn,
        ),
      );
      value = initVal;
      _isInitialized = true;
      _isInitializing = false;
    } else {
      throw HTError.circleInit(id!);
    }
  } else {
    value = null; // assign it even if it's null, for type check
  }
}