Beispiel #1
0
 public override JsExpression VisitArrayLiteralExpression(JsArrayLiteralExpression expression, object data)
 {
     if (expression.Elements.Count > 1)
     {
         _result = true;
         return(expression);
     }
     else
     {
         return(base.VisitArrayLiteralExpression(expression, data));
     }
 }
Beispiel #2
0
        public object VisitArrayLiteralExpression(JsArrayLiteralExpression expression, bool parenthesized)
        {
            _cb.Append("[");
            bool first = true;

            foreach (var x in expression.Elements)
            {
                if (!first)
                {
                    _cb.Append("," + _space);
                }
                if (x != null)
                {
                    VisitExpression(x, GetPrecedence(x.NodeType) >= PrecedenceComma);                     // We need to parenthesize comma expressions, eg. [1, (2, 3), 4]
                }
                first = false;
            }
            _cb.Append("]");
            return(null);
        }
            public override JsExpression VisitArrayLiteralExpression(JsArrayLiteralExpression expression, object data)
            {
                var l = VisitWithParamExpansion(expression.Elements);

                return(ReferenceEquals(l, expression.Elements) ? expression : JsExpression.ArrayLiteral(l));
            }
        public virtual JsExpression VisitArrayLiteralExpression(JsArrayLiteralExpression expression, TData data)
        {
            var after = VisitExpressions(expression.Elements, data);

            return(ReferenceEquals(after, expression.Elements) ? expression : JsExpression.ArrayLiteral(after));
        }