Exemplo n.º 1
0
/*
 *      public static JsNewExpression NakedNew(JsExpression expression)
 *      {
 *          return new JsNewExpression(expression.Invoke());
 *      }
 */

        public static JsNewExpression New(JsExpression type, params JsExpression[] arguments)
        {
            return(new JsNewExpression(type.Invoke(arguments)));
        }
 private JsExpression KoUnwrap(JsExpression expr, JsExpression rootExpression, bool isRootResult) =>
 isRootResult ? (rootExpression == expr ? expr : AddAnnotations(expr, rootExpression)) : AddAnnotations(expr.Invoke(), rootExpression);
Exemplo n.º 3
0
 public bool TryUnwrapJsFunctionInvoke(IMethodSymbol method, InvocationExpressionSyntax invocation, JsExpression methodTarget, JsExpression[] arguments, out JsExpression result)
 {
     if (Equals(method.ContainingType, Context.Instance.JsFunction) && method.Name == "invoke")
     {
         result = methodTarget.Invoke(arguments);
         return true;
     }
     result = null;
     return false;
 }
 private JsExpression KoUnwrap(JsExpression expr, JsExpression rootExpression, bool weakObservable) =>
 AddAnnotations(weakObservable ? new JsIdentifierExpression("ko").Member("unwrap").Invoke(expr) : expr.Invoke(), rootExpression);