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 import java.util.List; 011 012 /** 013 * Represents a JavaScript block in the global scope. 014 */ 015 public class JsGlobalBlock extends JsBlock { 016 017 public JsGlobalBlock() { 018 } 019 020 @Override 021 public boolean isGlobalBlock() { 022 return true; 023 } 024 025 @NotNull 026 @Override 027 public JsGlobalBlock deepCopy() { 028 JsGlobalBlock globalBlockCopy = new JsGlobalBlock(); 029 List<JsStatement> statementscopy = AstUtil.deepCopy(getStatements()); 030 globalBlockCopy.getStatements().addAll(statementscopy); 031 return globalBlockCopy.withMetadataFrom(this); 032 } 033 }