Beispiel #1
0
        public JsNode VisitArrayCreateResolveResult(ArrayCreateResolveResult res)
        {
            var jsArrayType = SkJs.GetJsArrayType((ArrayType)res.Type);

            JsExpression[] items = null;
            JsExpression   size  = null;

            if (res.InitializerElements.IsNotNullOrEmpty())
            {
                items = VisitExpressions(res.InitializerElements).ToArray();
            }
            else if (res.SizeArguments.IsNotNullOrEmpty())
            {
                size = VisitExpression(res.SizeArguments.Single());
            }

            return(Js.NewArray(jsArrayType, size, items));
        }