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

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: Update semantics to not throw on null. Merge to head. 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 3ab84c7dc809e0ce33018a5d292fe93d2917124b..f2432c35b0c9ac53b81d9607f5c45f46e25ede72 100644
--- a/lib/compiler/implementation/resolver.dart
+++ b/lib/compiler/implementation/resolver.dart
@@ -1050,7 +1050,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);
@@ -1142,6 +1142,7 @@ class ResolverVisitor extends CommonResolverVisitor<Element> {
case '&&':
case '||':
case 'is':
+ case 'as':
case '>>>':
return null;
}

Powered by Google App Engine
This is Rietveld 408576698