Exemplo n.º 1
0
        private JsFunction CompileInlineFunction(IMethod method, InlineCodeProvider provider)
        {
            var klass = CompileClass(method.DeclaringType);
            var ctx   = new MethodContext(_host, klass, method, new TryCatchBlock[0]);

            return(provider.GetImplementation(ctx));
        }
Exemplo n.º 2
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);
        }