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.google.dart.compiler.util.AstUtil; 008 import org.jetbrains.annotations.NotNull; 009 010 /** 011 * Represents the default option in a JavaScript swtich statement. 012 */ 013 public final class JsDefault extends JsSwitchMember { 014 @Override 015 public void accept(JsVisitor v) { 016 v.visitDefault(this); 017 } 018 019 @Override 020 public void traverse(JsVisitorWithContext v, JsContext ctx) { 021 if (v.visit(this, ctx)) { 022 v.acceptStatementList(statements); 023 } 024 v.endVisit(this, ctx); 025 } 026 027 @NotNull 028 @Override 029 public JsDefault deepCopy() { 030 JsDefault defaultCopy = new JsDefault(); 031 defaultCopy.statements.addAll(AstUtil.deepCopy(statements)); 032 return defaultCopy.withMetadataFrom(this); 033 } 034 }