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

Unified Diff: sdk/lib/_internal/compiler/implementation/resolved_visitor.dart

Issue 694353007: Move dart2js from sdk/lib/_internal/compiler to pkg/compiler (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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: sdk/lib/_internal/compiler/implementation/resolved_visitor.dart
diff --git a/sdk/lib/_internal/compiler/implementation/resolved_visitor.dart b/sdk/lib/_internal/compiler/implementation/resolved_visitor.dart
deleted file mode 100644
index 5d4ae3bcffeb20bcfad49996a829c49bd3b0e3ba..0000000000000000000000000000000000000000
--- a/sdk/lib/_internal/compiler/implementation/resolved_visitor.dart
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart2js;
-
-abstract class ResolvedVisitor<R> extends Visitor<R> {
- TreeElements elements;
-
- ResolvedVisitor(this.elements);
-
- R visitSend(Send node) {
- Element element = elements[node];
- if (elements.isAssert(node)) {
- return visitAssert(node);
- } else if (elements.isTypeLiteral(node)) {
- return visitTypeLiteralSend(node);
- } else if (node.isSuperCall) {
- return visitSuperSend(node);
- } else if (node.isOperator) {
- return visitOperatorSend(node);
- } else if (node.isPropertyAccess) {
- if (!Elements.isUnresolved(element) && element.impliesType) {
- return visitTypePrefixSend(node);
- } else {
- return visitGetterSend(node);
- }
- } else if (element != null && Initializers.isConstructorRedirect(node)) {
- return visitStaticSend(node);
- } else if (Elements.isClosureSend(node, element)) {
- return visitClosureSend(node);
- } else {
- if (Elements.isUnresolved(element)) {
- if (element == null) {
- // Example: f() with 'f' unbound.
- // This can only happen inside an instance method.
- return visitDynamicSend(node);
- } else {
- return visitStaticSend(node);
- }
- } else if (element.isInstanceMember) {
- // Example: f() with 'f' bound to instance method.
- return visitDynamicSend(node);
- } else if (!element.isInstanceMember) {
- // Example: A.f() or f() with 'f' bound to a static function.
- // Also includes new A() or new A.named() which is treated like a
- // static call to a factory.
- return visitStaticSend(node);
- } else {
- internalError("Cannot generate code for send", node: node);
- return null;
- }
- }
- }
-
- R visitSuperSend(Send node);
- R visitOperatorSend(Send node);
- R visitGetterSend(Send node);
- R visitClosureSend(Send node);
- R visitDynamicSend(Send node);
- R visitStaticSend(Send node);
-
- /// Visitor callback for a type literal.
- R visitTypeLiteralSend(Send node);
-
- /// Visitor callback for the class prefix of a static access, like `Foo` in
- /// `Foo.staticField`.
- // TODO(johnniwinther): Remove this when not needed by the dart backend.
- R visitTypePrefixSend(Send node);
-
- R visitAssert(Send node);
-
- void internalError(String reason, {Node node});
-
- R visitNode(Node node) {
- internalError("Unhandled node", node: node);
- return null;
- }
-}

Powered by Google App Engine
This is Rietveld 408576698