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

Side by Side Diff: pkg/compiler/lib/src/resolution/members.dart

Issue 794593002: Allow dart2js to compile calls to type literals when prefixed. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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/type_literal_prefix_call_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 resolution; 5 part of resolution;
6 6
7 abstract class TreeElements { 7 abstract class TreeElements {
8 AnalyzableElement get analyzedElement; 8 AnalyzableElement get analyzedElement;
9 Iterable<Node> get superUses; 9 Iterable<Node> get superUses;
10 10
(...skipping 2770 matching lines...) Expand 10 before | Expand all | Expand 10 after
2781 type = target.computeType(compiler); 2781 type = target.computeType(compiler);
2782 } 2782 }
2783 registry.registerTypeLiteral(node, type); 2783 registry.registerTypeLiteral(node, type);
2784 2784
2785 // Don't try to make constants of calls to type literals. 2785 // Don't try to make constants of calls to type literals.
2786 if (!node.isCall) { 2786 if (!node.isCall) {
2787 analyzeConstantDeferred(node); 2787 analyzeConstantDeferred(node);
2788 } else { 2788 } else {
2789 // The node itself is not a constant but we register the selector (the 2789 // The node itself is not a constant but we register the selector (the
2790 // identifier that refers to the class/typedef) as a constant. 2790 // identifier that refers to the class/typedef) as a constant.
2791 if (node.receiver != null) {
2792 // This is a hack for the case of prefix.Type, we need to store
2793 // the element on the receiver, so [analyzeConstant] can build
2794 // the type literal from the receiver.
Johnni Winther 2014/12/11 13:12:07 'receiver' -> 'selector' x2
sigurdm 2014/12/11 13:31:55 Tak
2795 registry.useElement(node.selector, target);
2796 }
2791 analyzeConstantDeferred(node.selector); 2797 analyzeConstantDeferred(node.selector);
2792 } 2798 }
2793 } 2799 }
2794 if (isPotentiallyMutableTarget(target)) { 2800 if (isPotentiallyMutableTarget(target)) {
2795 if (enclosingElement != target.enclosingElement) { 2801 if (enclosingElement != target.enclosingElement) {
2796 for (Node scope in promotionScope) { 2802 for (Node scope in promotionScope) {
2797 registry.setAccessedByClosureIn(scope, target, node); 2803 registry.setAccessedByClosureIn(scope, target, node);
2798 } 2804 }
2799 } 2805 }
2800 } 2806 }
(...skipping 2175 matching lines...) Expand 10 before | Expand all | Expand 10 after
4976 } 4982 }
4977 4983
4978 /// The result for the resolution of the `assert` method. 4984 /// The result for the resolution of the `assert` method.
4979 class AssertResult implements ResolutionResult { 4985 class AssertResult implements ResolutionResult {
4980 const AssertResult(); 4986 const AssertResult();
4981 4987
4982 Element get element => null; 4988 Element get element => null;
4983 4989
4984 String toString() => 'AssertResult()'; 4990 String toString() => 'AssertResult()';
4985 } 4991 }
OLDNEW
« no previous file with comments | « no previous file | tests/language/type_literal_prefix_call_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698