예제 #1
0
        private void Inline(InlineCodeProvider provider, IMethod method)
        {
            var jsMethod = method.Data as JsGeneratedMethod;

            if (jsMethod != null)
            {
                return;
            }

            var impl = CompileInlineFunction(method, provider);

            if (impl == null)
            {
                var info = method.GetInlineInfo();
                if (info != null)
                {
                    CompileInlineMethod(method, info);
                    return;
                }

                throw new NotImplementedException();
            }

            jsMethod    = new JsGeneratedMethod(method.JsFullName(), impl);
            method.Data = jsMethod;

            var klass = CompileClass(method.DeclaringType);

            klass.Add(jsMethod);
        }
예제 #2
0
        private void CompileInlineMethod(IMethod method, InlineMethodInfo info)
        {
            var jsMethod = method.Data as JsGeneratedMethod;

            if (jsMethod != null)
            {
                return;
            }

            var func  = CompileInlineFunction(method, info);
            var klass = CompileClass(method.DeclaringType);

            jsMethod    = new JsGeneratedMethod(method.JsFullName(), func);
            method.Data = jsMethod;

            klass.Add(jsMethod);
        }