Esempio n. 1
0
        static ArrayLiteral ConvertToBindingArrayLiteral(ArrayLiteral arrayLiteral)
        {
            ArrayLiteral bindingLiteral = null;

            if (arrayLiteral != null)
            {
                bindingLiteral = new ArrayLiteral(arrayLiteral.Context)
                {
                    TerminatingContext = arrayLiteral.TerminatingContext
                };
                if (arrayLiteral.Elements != null)
                {
                    bindingLiteral.Elements = new AstNodeList(arrayLiteral.Elements.Context);
                    foreach (var item in arrayLiteral.Elements)
                    {
                        bindingLiteral.Elements.Append(ConvertToBinding(item));
                    }
                }
            }

            return(bindingLiteral);
        }
Esempio n. 2
0
        private static ArrayLiteral ConvertFromBindingArrayLiteral(ArrayLiteral bindingLiteral)
        {
            ArrayLiteral arrayLiteral = null;

            if (bindingLiteral != null)
            {
                arrayLiteral = new ArrayLiteral(bindingLiteral.Context)
                {
                    TerminatingContext = bindingLiteral.TerminatingContext,
                };
                if (bindingLiteral.Elements != null)
                {
                    arrayLiteral.Elements = new AstNodeList(bindingLiteral.Elements.Context);
                    foreach (var item in bindingLiteral.Elements)
                    {
                        arrayLiteral.Elements.Append(ConvertFromBinding(item));
                    }
                }
            }

            return(arrayLiteral);
        }
 public ComputedPropertyField(ArrayLiteral literalNode, SourceContext context) : base(literalNode.Context.Code, PrimitiveType.Other, context)
 {
     ArrayNode = literalNode;
 }