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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/resolved_visitor.dart

Issue 23171004: Fix resolved visitor to dispatch a constructor redirection to a static send instead of a closure se… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/language/issue12284_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart2js; 5 part of dart2js;
6 6
7 abstract class ResolvedVisitor<R> extends Visitor<R> { 7 abstract class ResolvedVisitor<R> extends Visitor<R> {
8 TreeElements elements; 8 TreeElements elements;
9 9
10 ResolvedVisitor(this.elements); 10 ResolvedVisitor(this.elements);
11 11
12 R visitSend(Send node) { 12 R visitSend(Send node) {
13 Element element = elements[node];
13 if (node.isSuperCall) { 14 if (node.isSuperCall) {
14 return visitSuperSend(node); 15 return visitSuperSend(node);
15 } else if (node.isOperator) { 16 } else if (node.isOperator) {
16 return visitOperatorSend(node); 17 return visitOperatorSend(node);
17 } else if (node.isPropertyAccess) { 18 } else if (node.isPropertyAccess) {
18 Element element = elements[node];
19 if (!Elements.isUnresolved(element) && element.impliesType()) { 19 if (!Elements.isUnresolved(element) && element.impliesType()) {
20 // A reference to a class literal, typedef or type variable. 20 // A reference to a class literal, typedef or type variable.
21 return visitTypeReferenceSend(node); 21 return visitTypeReferenceSend(node);
22 } else { 22 } else {
23 return visitGetterSend(node); 23 return visitGetterSend(node);
24 } 24 }
25 } else if (Elements.isClosureSend(node, elements[node])) { 25 } else if (element != null && Initializers.isConstructorRedirect(node)) {
26 return visitStaticSend(node);
27 } else if (Elements.isClosureSend(node, element)) {
26 return visitClosureSend(node); 28 return visitClosureSend(node);
27 } else { 29 } else {
28 Element element = elements[node];
29 if (Elements.isUnresolved(element)) { 30 if (Elements.isUnresolved(element)) {
30 if (element == null) { 31 if (element == null) {
31 // Example: f() with 'f' unbound. 32 // Example: f() with 'f' unbound.
32 // This can only happen inside an instance method. 33 // This can only happen inside an instance method.
33 return visitDynamicSend(node); 34 return visitDynamicSend(node);
34 } else { 35 } else {
35 return visitStaticSend(node); 36 return visitStaticSend(node);
36 } 37 }
37 } else if (element.impliesType()) { 38 } else if (element.impliesType()) {
38 // A reference to a class literal, typedef or type variable. 39 // A reference to a class literal, typedef or type variable.
(...skipping 19 matching lines...) Expand all
58 R visitDynamicSend(Send node); 59 R visitDynamicSend(Send node);
59 R visitStaticSend(Send node); 60 R visitStaticSend(Send node);
60 R visitTypeReferenceSend(Send node); 61 R visitTypeReferenceSend(Send node);
61 62
62 void internalError(String reason, {Node node}); 63 void internalError(String reason, {Node node});
63 64
64 R visitNode(Node node) { 65 R visitNode(Node node) {
65 internalError("Unhandled node", node: node); 66 internalError("Unhandled node", node: node);
66 } 67 }
67 } 68 }
OLDNEW
« no previous file with comments | « no previous file | tests/language/issue12284_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698