Ejemplo n.º 1
0
        void FillMethods(JsObject def)
        {
            var isStatic = def == _JsType.staticDefinition;

            foreach (var funcName in def)
            {
                if (funcName == "toString")
                {
                    continue;
                }
                var func = def[funcName].As <JsFunction>();
                if (Js.Typeof(func) != "function")
                {
                    continue;
                }
                var methodName = JsNamingHelper.JsFunctionNameToClrMethodName(funcName);
                var methods    = _MethodsByName[methodName];
                if (methods == null)
                {
                    methods = new JsArray <JsImplMethodInfo>();
                    _MethodsByName[methodName] = methods;
                }
                //TODO: check overrides and parameters
                var method = new JsImplMethodInfo();
                methods.push(method);
                _Methods.push(method);
                method._Name          = methodName;
                method.JsName         = funcName;
                method.JsFunction     = func;
                method._DeclaringType = this;
                method._IsStatic      = _JsType.staticDefinition != null && _JsType.staticDefinition[funcName] == func;
                //var propType = VM.resolveMemberType2(def, propName);
                //if (propType != null)
                //  prop._MethodType = _TypeOf(propType);
            }
        }
Ejemplo n.º 2
0
        void FillMethods(JsObject def)
        {
            var isStatic = def == _JsType.staticDefinition;
            foreach (var funcName in def)
            {
                if (funcName == "toString")
                    continue;
                var func = def[funcName].As<JsFunction>();
                if (Js.Typeof(func) != "function")
                    continue;
                var methodName = JsNamingHelper.JsFunctionNameToClrMethodName(funcName);
                var methods = _MethodsByName[methodName];
                if (methods == null)
                {
                    methods = new JsArray<JsImplMethodInfo>();
                    _MethodsByName[methodName] = methods;
                }
                //TODO: check overrides and parameters
                var method = new JsImplMethodInfo();
                methods.push(method);
                _Methods.push(method);
                method._Name = methodName;
                method.JsName = funcName;
                method.JsFunction = func;
                method._DeclaringType = this;
                method._IsStatic = _JsType.staticDefinition != null && _JsType.staticDefinition[funcName] == func;
                //var propType = VM.resolveMemberType2(def, propName);
                //if (propType != null)
                //  prop._MethodType = _TypeOf(propType);
            }

        }