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

Side by Side Diff: frog/leg/elements/elements.dart

Issue 9086010: closure calls (just the invocation part). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 years, 11 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 | frog/leg/leg.dart » ('j') | frog/leg/ssa/builder.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 return (element != null) 349 return (element != null)
350 && !element.isInstanceMember() 350 && !element.isInstanceMember()
351 && (element.kind === ElementKind.FIELD); 351 && (element.kind === ElementKind.FIELD);
352 } 352 }
353 353
354 static bool isInstanceMethod(Element element) { 354 static bool isInstanceMethod(Element element) {
355 return (element != null) 355 return (element != null)
356 && element.isInstanceMember() 356 && element.isInstanceMember()
357 && (element.kind === ElementKind.FUNCTION); 357 && (element.kind === ElementKind.FUNCTION);
358 } 358 }
359
360 static bool isClosureSend(Send send, TreeElements elements) {
361 if (send.isPropertyAccess) return false;
362 if (send.receiver !== null) return false;
363 Element element = elements[send];
364 // (o)() or foo()().
365 if (element === null && send.selector.asIdentifier() === null) return true;
366 // foo() with foo a local or a parameter.
367 if (element.kind === ElementKind.VARIABLE ||
kasperl 2012/01/05 12:52:19 Should we have element.isVariable() and element.is
floitsch 2012/01/05 13:59:20 Done.
368 element.kind === ElementKind.PARAMETER) {
369 return true;
370 }
371 return false;
372 }
359 } 373 }
OLDNEW
« no previous file with comments | « no previous file | frog/leg/leg.dart » ('j') | frog/leg/ssa/builder.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698