public _Field(FieldTrait def, VectorInstFromScriptClass inst) : base(def.name, inst, inst.applicationDomain, def.isStatic) { setUnderlyingFieldInfo(def.underlyingFieldInfo); setIsReadOnly(def.isReadOnly); setFieldType(inst._substituteElement(def.fieldType)); setMetadata(def.metadata); inst.m_incompleteTraitsByToken[def.underlyingFieldInfo.MetadataToken] = this; }
public _Method(MethodTrait def, VectorInstFromScriptClass inst) : base(def.name, inst, inst.applicationDomain, def.isStatic) { var defParams = def.getParameters(); var instParams = (defParams.length == 0) ? Array.Empty <MethodTraitParameter>() : new MethodTraitParameter[defParams.length]; for (int i = 0; i < instParams.Length; i++) { var defParam = defParams[i]; var instParamType = inst._substituteElement(defParam.type); instParams[i] = new MethodTraitParameter( defParam.name, instParamType, defParam.isOptional, defParam.hasDefault, defParam.defaultValue); } setIsOverride(def.isOverride); setSignature(def.hasReturn, def.hasReturn ? inst._substituteElement(def.returnType) : null, instParams, def.hasRest); setMetadata(def.metadata); setUnderlyingMethodInfo(def.underlyingMethodInfo); inst.m_incompleteTraitsByToken[def.underlyingMethodInfo.MetadataToken] = this; }
public _Ctor(ClassConstructor def, VectorInstFromScriptClass inst) : base(inst) { var defParams = def.getParameters(); var instParams = (defParams.length == 0) ? Array.Empty <MethodTraitParameter>() : new MethodTraitParameter[defParams.length]; for (int i = 0; i < instParams.Length; i++) { var defParam = defParams[i]; var instParamType = inst._substituteElement(defParam.type); instParams[i] = new MethodTraitParameter( defParam.name, instParamType, defParam.isOptional, defParam.hasDefault, defParam.defaultValue); } setSignature(instParams, def.hasRest); setMetadata(def.metadata); setUnderlyingCtorInfo(def.underlyingConstructorInfo); }