OLD | NEW |
---|---|
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 inferrer_visitor; | 5 library inferrer_visitor; |
6 | 6 |
7 import 'dart:collection' show | 7 import 'dart:collection' show |
8 IterableMixin; | 8 IterableMixin; |
9 | 9 |
10 import '../compiler.dart' show | 10 import '../compiler.dart' show |
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
775 @override | 775 @override |
776 T bulkHandlePrefix(SendSet node, _) { | 776 T bulkHandlePrefix(SendSet node, _) { |
777 return handleSendSet(node); | 777 return handleSendSet(node); |
778 } | 778 } |
779 | 779 |
780 @override | 780 @override |
781 T bulkHandlePostfix(SendSet node, _) { | 781 T bulkHandlePostfix(SendSet node, _) { |
782 return handleSendSet(node); | 782 return handleSendSet(node); |
783 } | 783 } |
784 | 784 |
785 @override | |
786 T visitAssert(Send node, Node expression, _) { | |
787 if (!compiler.enableUserAssertions) { | |
788 return types.nullType; | |
789 } | |
790 return handleAssert(node, expression); | |
791 } | |
792 | |
793 /// Handle an enabled assertion of [expression]. | 785 /// Handle an enabled assertion of [expression]. |
Johnni Winther
2015/09/01 13:32:05
Remove as well.
Lasse Reichstein Nielsen
2015/09/03 11:23:25
Done.
| |
794 T handleAssert(Send node, Node expression); | |
795 | |
796 T visitNode(Node node) { | 786 T visitNode(Node node) { |
797 return node.visitChildren(this); | 787 return node.visitChildren(this); |
798 } | 788 } |
799 | 789 |
800 T visit(Node node) { | 790 T visit(Node node) { |
801 return node == null ? null : node.accept(this); | 791 return node == null ? null : node.accept(this); |
802 } | 792 } |
803 | 793 |
804 T visitFunctionDeclaration(FunctionDeclaration node) { | 794 T visitFunctionDeclaration(FunctionDeclaration node) { |
805 locals.update(elements[node], types.functionType, node); | 795 locals.update(elements[node], types.functionType, node); |
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1522 return type; | 1512 return type; |
1523 } | 1513 } |
1524 | 1514 |
1525 T visitCascade(Cascade node) { | 1515 T visitCascade(Cascade node) { |
1526 // Ignore the result of the cascade send and return the type of the cascade | 1516 // Ignore the result of the cascade send and return the type of the cascade |
1527 // receiver. | 1517 // receiver. |
1528 visit(node.expression); | 1518 visit(node.expression); |
1529 return cascadeReceiverStack.removeLast(); | 1519 return cascadeReceiverStack.removeLast(); |
1530 } | 1520 } |
1531 } | 1521 } |
OLD | NEW |