コード例 #1
0
            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;
            }
コード例 #2
0
            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;
            }
コード例 #3
0
            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);
            }