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

Unified Diff: lib/compiler/implementation/resolver.dart

Issue 10540048: Implement 'as' operator. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: No entries in language.status, vm and dartc already implemented 'as'. Created 8 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 side-by-side diff with in-line comments
Download patch
Index: lib/compiler/implementation/resolver.dart
diff --git a/lib/compiler/implementation/resolver.dart b/lib/compiler/implementation/resolver.dart
index 0c37c2331ce61c53d7977ccb95286af57a1d5c3e..fce5ad0efb3ebb8192a872983139ed7f183b6632 100644
--- a/lib/compiler/implementation/resolver.dart
+++ b/lib/compiler/implementation/resolver.dart
@@ -1141,7 +1141,7 @@ class ResolverVisitor extends CommonResolverVisitor<Element> {
Element target = resolveSend(node);
if (node.isOperator) {
Operator op = node.selector.asOperator();
- if (op.source.stringValue === 'is') {
+ if (op.source.stringValue === 'is' || op.source.stringValue === 'as') {
resolveTypeTest(node.arguments.head);
assert(node.arguments.tail.isEmpty());
mapping.setSelector(node, Selector.BINARY_OPERATOR);
@@ -1233,6 +1233,7 @@ class ResolverVisitor extends CommonResolverVisitor<Element> {
case '&&':
case '||':
case 'is':
+ case 'as':
case '>>>':
return null;
}

Powered by Google App Engine
This is Rietveld 408576698