001 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
002 // for details. All rights reserved. Use of this source code is governed by a
003 // BSD-style license that can be found in the LICENSE file.
004
005 package com.google.dart.compiler.backend.js.ast;
006
007 import com.intellij.util.SmartList;
008
009 import java.util.List;
010
011 /**
012 * Represents a JavaScript expression for array literals.
013 */
014 public final class JsArrayLiteral extends JsLiteral {
015 private final List<JsExpression> expressions;
016
017 public JsArrayLiteral() {
018 expressions = new SmartList<JsExpression>();
019 }
020
021 public JsArrayLiteral(List<JsExpression> expressions) {
022 this.expressions = expressions;
023 }
024
025 public List<JsExpression> getExpressions() {
026 return expressions;
027 }
028
029 @Override
030 public void accept(JsVisitor v) {
031 v.visitArray(this);
032 }
033
034 @Override
035 public void acceptChildren(JsVisitor visitor) {
036 visitor.acceptWithInsertRemove(expressions);
037 }
038 }