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

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

Issue 12334070: Support runtime check of function types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Minor fix Created 7 years, 6 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
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 tree; 5 part of tree;
6 6
7 abstract class Visitor<R> { 7 abstract class Visitor<R> {
8 const Visitor(); 8 const Visitor();
9 9
10 R visitNode(Node node); 10 R visitNode(Node node);
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 bool get isLogicalOr => 367 bool get isLogicalOr =>
368 isOperator && identical(selector.asOperator().source.stringValue, '||'); 368 isOperator && identical(selector.asOperator().source.stringValue, '||');
369 bool get isParameterCheck => 369 bool get isParameterCheck =>
370 isOperator && identical(selector.asOperator().source.stringValue, '?'); 370 isOperator && identical(selector.asOperator().source.stringValue, '?');
371 371
372 bool get isTypeCast { 372 bool get isTypeCast {
373 return isOperator 373 return isOperator
374 && identical(selector.asOperator().source.stringValue, 'as'); 374 && identical(selector.asOperator().source.stringValue, 'as');
375 } 375 }
376 376
377 bool get isTypeTest {
378 return isOperator
379 && identical(selector.asOperator().source.stringValue, 'is');
380 }
381
377 bool get isIsCheck { 382 bool get isIsCheck {
378 return isOperator 383 return isOperator
379 && identical(selector.asOperator().source.stringValue, 'is') 384 && identical(selector.asOperator().source.stringValue, 'is')
380 && arguments.head.asSend() == null; 385 && arguments.head.asSend() == null;
381 } 386 }
382 387
383 bool get isIsNotCheck { 388 bool get isIsNotCheck {
384 return isOperator 389 return isOperator
385 && identical(selector.asOperator().source.stringValue, 'is') 390 && identical(selector.asOperator().source.stringValue, 'is')
386 && arguments.head.asSend() != null; 391 && arguments.head.asSend() != null;
(...skipping 1725 matching lines...) Expand 10 before | Expand all | Expand 10 after
2112 * argument). 2117 * argument).
2113 * 2118 *
2114 * TODO(ahe): This method is controversial, the team needs to discuss 2119 * TODO(ahe): This method is controversial, the team needs to discuss
2115 * if top-level methods are acceptable and what naming conventions to 2120 * if top-level methods are acceptable and what naming conventions to
2116 * use. 2121 * use.
2117 */ 2122 */
2118 initializerDo(Node node, f(Node node)) { 2123 initializerDo(Node node, f(Node node)) {
2119 SendSet send = node.asSendSet(); 2124 SendSet send = node.asSendSet();
2120 if (send != null) return f(send.arguments.head); 2125 if (send != null) return f(send.arguments.head);
2121 } 2126 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698