| 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 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 748 @override | 748 @override |
| 749 SemanticSendVisitor get sendVisitor => this; | 749 SemanticSendVisitor get sendVisitor => this; |
| 750 | 750 |
| 751 @override | 751 @override |
| 752 T apply(Node node, _) => visit(node); | 752 T apply(Node node, _) => visit(node); |
| 753 | 753 |
| 754 T handleSendSet(SendSet node); | 754 T handleSendSet(SendSet node); |
| 755 | 755 |
| 756 T handleDynamicInvoke(Send node); | 756 T handleDynamicInvoke(Send node); |
| 757 | 757 |
| 758 T visitAssert(Assert node) { |
| 759 // Avoid pollution from assert statement unless enabled. |
| 760 if (compiler.enableUserAssertions) { |
| 761 super.visitAssert(node); |
| 762 } |
| 763 return null; |
| 764 } |
| 765 |
| 758 T visitAsyncForIn(AsyncForIn node); | 766 T visitAsyncForIn(AsyncForIn node); |
| 759 | 767 |
| 760 T visitSyncForIn(SyncForIn node); | 768 T visitSyncForIn(SyncForIn node); |
| 761 | 769 |
| 762 T visitReturn(Return node); | 770 T visitReturn(Return node); |
| 763 | 771 |
| 764 T visitFunctionExpression(FunctionExpression node); | 772 T visitFunctionExpression(FunctionExpression node); |
| 765 | 773 |
| 766 @override | 774 @override |
| 767 T bulkHandleSet(SendSet node, _) { | 775 T bulkHandleSet(SendSet node, _) { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 786 @override | 794 @override |
| 787 T bulkHandlePostfix(SendSet node, _) { | 795 T bulkHandlePostfix(SendSet node, _) { |
| 788 return handleSendSet(node); | 796 return handleSendSet(node); |
| 789 } | 797 } |
| 790 | 798 |
| 791 @override | 799 @override |
| 792 T bulkHandleError(Node node, ErroneousElement error, _) { | 800 T bulkHandleError(Node node, ErroneousElement error, _) { |
| 793 return types.dynamicType; | 801 return types.dynamicType; |
| 794 } | 802 } |
| 795 | 803 |
| 796 @override | |
| 797 T visitAssert(Send node, Node expression, _) { | |
| 798 if (!compiler.enableUserAssertions) { | |
| 799 return types.nullType; | |
| 800 } | |
| 801 return handleAssert(node, expression); | |
| 802 } | |
| 803 | |
| 804 /// Handle an enabled assertion of [expression]. | |
| 805 T handleAssert(Send node, Node expression); | |
| 806 | |
| 807 T visitNode(Node node) { | 804 T visitNode(Node node) { |
| 808 return node.visitChildren(this); | 805 return node.visitChildren(this); |
| 809 } | 806 } |
| 810 | 807 |
| 811 T visit(Node node) { | 808 T visit(Node node) { |
| 812 return node == null ? null : node.accept(this); | 809 return node == null ? null : node.accept(this); |
| 813 } | 810 } |
| 814 | 811 |
| 815 T visitFunctionDeclaration(FunctionDeclaration node) { | 812 T visitFunctionDeclaration(FunctionDeclaration node) { |
| 816 locals.update(elements[node], types.functionType, node); | 813 locals.update(elements[node], types.functionType, node); |
| (...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1533 return type; | 1530 return type; |
| 1534 } | 1531 } |
| 1535 | 1532 |
| 1536 T visitCascade(Cascade node) { | 1533 T visitCascade(Cascade node) { |
| 1537 // Ignore the result of the cascade send and return the type of the cascade | 1534 // Ignore the result of the cascade send and return the type of the cascade |
| 1538 // receiver. | 1535 // receiver. |
| 1539 visit(node.expression); | 1536 visit(node.expression); |
| 1540 return cascadeReceiverStack.removeLast(); | 1537 return cascadeReceiverStack.removeLast(); |
| 1541 } | 1538 } |
| 1542 } | 1539 } |
| OLD | NEW |