resolve method

  1. @override
void resolve()
override

Implementation

@override
void resolve() {
  if (_isResolved) return;
  HTStruct static = interpreter.execute(
    context: HTContext(
      filename: fileName,
      moduleName: moduleName,
      ip: staticDefinitionIp!,
      namespace: closure != null ? closure as HTNamespace : null,
    ),
  );
  if (closure != null) {
    if (prototypeId != null) {
      static.prototype = closure!.memberGet(prototypeId!,
          from: closure!.fullName, isRecursive: true);
    } else if (id != interpreter.lexicon.globalPrototypeId) {
      static.prototype = interpreter.globalNamespace
          .memberGet(interpreter.lexicon.globalPrototypeId);
    }
  }
  _self = interpreter.execute(
    context: HTContext(
      filename: fileName,
      moduleName: moduleName,
      ip: definitionIp!,
      namespace: closure != null ? closure as HTNamespace : null,
    ),
  );
  _self!.prototype = static;
  _self!.declaration = this;

  if (closure != null) {
    if (mixinIds.isNotEmpty) {
      for (final mixinId in mixinIds) {
        final mixinObj = closure!
            .memberGet(mixinId, from: closure!.fullName, isRecursive: true);
        static.assign(mixinObj);
      }
    }
  }
  _isResolved = true;
}