Chromium Code Reviews| Index: dart/frog/leg/ssa/builder.dart |
| =================================================================== |
| --- dart/frog/leg/ssa/builder.dart (revision 4132) |
| +++ dart/frog/leg/ssa/builder.dart (working copy) |
| @@ -1220,7 +1220,19 @@ |
| } else if (const SourceString("is") == op.source) { |
| visit(node.receiver); |
| HInstruction expression = pop(); |
| - push(new HIs(elements[node.arguments.head], expression)); |
| + Node argument = node.arguments.head; |
| + TypeAnnotation type = argument.asTypeAnnotation(); |
| + bool isNot = false; |
| + if (type == null) { |
| + type = argument.asSend().receiver; |
|
ahe
2012/02/13 09:59:57
You're repeating the pattern from the resolver her
|
| + isNot = true; |
| + } |
| + HInstruction instruction = new HIs(elements[type], expression); |
| + if (isNot) { |
| + add(instruction); |
| + instruction = new HNot(instruction); |
| + } |
| + push(instruction); |
| } else { |
| visit(node.receiver); |
| visit(node.argumentsNode); |