示例#1
0
        private void CompileOp(IType type, UnaryOperator op)
        {
            // exclude natively supported types
            if (!HasOperators(type))
            {
                return;
            }

            var method = _operators.Find(op, type);

            if (method == null)
            {
                return;
            }

            if (method.Data != null)
            {
                return;
            }

            var jsMethod = CompileMethod(method);

            var func = new JsFunction(null);

            func.Body.Add(jsMethod.FullName.Id().Call("this".Id()).Return());

            ExtendPrototype(type, func, op.JsName());
        }
示例#2
0
 public IMethod Find(BinaryOperator op, IType left, IType right)
 {
     return(_opCache.Find(op, left, right));
 }