Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(494)

Unified Diff: compiler/java/com/google/dart/compiler/backend/js/TranslationContext.java

Issue 9479013: Remove backends. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: More clean up Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: compiler/java/com/google/dart/compiler/backend/js/TranslationContext.java
diff --git a/compiler/java/com/google/dart/compiler/backend/js/TranslationContext.java b/compiler/java/com/google/dart/compiler/backend/js/TranslationContext.java
deleted file mode 100644
index 6240e61857faa69dc539e46d416e075c7e848fe9..0000000000000000000000000000000000000000
--- a/compiler/java/com/google/dart/compiler/backend/js/TranslationContext.java
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-package com.google.dart.compiler.backend.js;
-
-import com.google.dart.compiler.ast.DartFunction;
-import com.google.dart.compiler.ast.DartNode;
-import com.google.dart.compiler.ast.DartUnit;
-import com.google.dart.compiler.backend.js.ast.JsFunction;
-import com.google.dart.compiler.backend.js.ast.JsProgram;
-import com.google.dart.compiler.backend.js.ast.JsScope;
-import com.google.dart.compiler.resolver.Element;
-import com.google.dart.compiler.resolver.LibraryElement;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Information generated by {@link GenerateNamesAndScopes} and consumed by
- * {@link GenerateJavascriptAST}.
- */
-public class TranslationContext {
- private final DartMangler mangler;
- private final Map<Element, JsScope> memberScopes = new HashMap<Element, JsScope>();
- private final Map<DartFunction, JsFunction> methods = new HashMap<DartFunction, JsFunction>();
- private final JsNameProvider names;
- private final JsProgram program;
-
- private TranslationContext(JsProgram program, DartMangler mangler) {
- this.program = program;
- this.mangler = mangler;
- this.names = new JsNameProvider(program, mangler);
- }
-
- public DartMangler getMangler() {
- return mangler;
- }
-
- public Map<Element, JsScope> getMemberScopes() {
- return memberScopes;
- }
-
- public Map<DartFunction, JsFunction> getMethods() {
- return methods;
- }
-
- public JsNameProvider getNames() {
- return names;
- }
-
- public JsProgram getProgram() {
- return program;
- }
-
- /**
- *
- * @param unit Unit to create translation context for
- * @param program
- * @param mangler
- * @param filterNode If not null, create names for this node only.
- * @return
- */
- public static TranslationContext createContext(DartUnit unit, JsProgram program,
- DartMangler mangler, DartNode filterNode) {
- TranslationContext translationContext = new TranslationContext(program, mangler);
- LibraryElement unitLibrary = unit.getLibrary().getElement();
- GenerateNamesAndScopes visitor = new GenerateNamesAndScopes(translationContext, unitLibrary);
- if (filterNode != null) {
- visitor.accept(filterNode);
- } else {
- visitor.accept(unit);
- }
- return translationContext;
- }
-
-
-}

Powered by Google App Engine
This is Rietveld 408576698