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

Side by Side Diff: lib/compiler/implementation/elements/elements.dart

Issue 10834270: Implement call operator. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Simplify nested loop and add TODO.p Created 8 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 | « lib/compiler/implementation/compiler.dart ('k') | lib/compiler/implementation/enqueue.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 #library('elements'); 5 #library('elements');
6 6
7 #import('../tree/tree.dart'); 7 #import('../tree/tree.dart');
8 #import('../scanner/scannerlib.dart'); 8 #import('../scanner/scannerlib.dart');
9 #import('../leg.dart'); // TODO(karlklose): we only need type. 9 #import('../leg.dart'); // TODO(karlklose): we only need type.
10 #import('../util/util.dart'); 10 #import('../util/util.dart');
(...skipping 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after
1143 } 1143 }
1144 1144
1145 static bool isInstanceMethod(Element element) { 1145 static bool isInstanceMethod(Element element) {
1146 return (element != null) 1146 return (element != null)
1147 && element.isInstanceMember() 1147 && element.isInstanceMember()
1148 && (element.kind === ElementKind.FUNCTION); 1148 && (element.kind === ElementKind.FUNCTION);
1149 } 1149 }
1150 1150
1151 static bool isInstanceSend(Send send, TreeElements elements) { 1151 static bool isInstanceSend(Send send, TreeElements elements) {
1152 Element element = elements[send]; 1152 Element element = elements[send];
1153 if (element === null) return !isClosureSend(send, elements); 1153 if (element === null) return !isClosureSend(send, element);
1154 return isInstanceMethod(element) || isInstanceField(element); 1154 return isInstanceMethod(element) || isInstanceField(element);
1155 } 1155 }
1156 1156
1157 static bool isClosureSend(Send send, TreeElements elements) { 1157 static bool isClosureSend(Send send, Element element) {
1158 if (send.isPropertyAccess) return false; 1158 if (send.isPropertyAccess) return false;
1159 if (send.receiver !== null) return false; 1159 if (send.receiver !== null) return false;
1160 Element element = elements[send];
1161 // (o)() or foo()(). 1160 // (o)() or foo()().
1162 if (element === null && send.selector.asIdentifier() === null) return true; 1161 if (element === null && send.selector.asIdentifier() === null) return true;
1163 if (element === null) return false; 1162 if (element === null) return false;
1164 // foo() with foo a local or a parameter. 1163 // foo() with foo a local or a parameter.
1165 return isLocal(element); 1164 return isLocal(element);
1166 } 1165 }
1167 1166
1168 static SourceString constructConstructorName(SourceString receiver, 1167 static SourceString constructConstructorName(SourceString receiver,
1169 SourceString selector) { 1168 SourceString selector) {
1170 String r = receiver.slowToString(); 1169 String r = receiver.slowToString();
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1285 TypeVariableElement(name, Element enclosing, this.cachedNode, 1284 TypeVariableElement(name, Element enclosing, this.cachedNode,
1286 [this.type, this.bound]) 1285 [this.type, this.bound])
1287 : super(name, ElementKind.TYPE_VARIABLE, enclosing); 1286 : super(name, ElementKind.TYPE_VARIABLE, enclosing);
1288 1287
1289 TypeVariableType computeType(compiler) => type; 1288 TypeVariableType computeType(compiler) => type;
1290 1289
1291 Node parseNode(compiler) => cachedNode; 1290 Node parseNode(compiler) => cachedNode;
1292 1291
1293 String toString() => "${enclosingElement.toString()}.${name.slowToString()}"; 1292 String toString() => "${enclosingElement.toString()}.${name.slowToString()}";
1294 } 1293 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/compiler.dart ('k') | lib/compiler/implementation/enqueue.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698