OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 part of dart2js.semantics_visitor_test; | 5 part of dart2js.semantics_visitor_test; |
6 | 6 |
7 const Map<String, List<Test>> SEND_TESTS = const { | 7 const Map<String, List<Test>> SEND_TESTS = const { |
8 'Parameters': const [ | 8 'Parameters': const [ |
9 // Parameters | 9 // Parameters |
10 const Test('m(o) => o;', | 10 const Test('m(o) => o;', |
(...skipping 1724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1735 m() => dynamic--; | 1735 m() => dynamic--; |
1736 ''', | 1736 ''', |
1737 const Visit(VisitKind.VISIT_DYNAMIC_TYPE_LITERAL_POSTFIX, | 1737 const Visit(VisitKind.VISIT_DYNAMIC_TYPE_LITERAL_POSTFIX, |
1738 constant: 'dynamic', | 1738 constant: 'dynamic', |
1739 operator: '--')), | 1739 operator: '--')), |
1740 ], | 1740 ], |
1741 'Assert': const [ | 1741 'Assert': const [ |
1742 // Assert | 1742 // Assert |
1743 const Test( | 1743 const Test( |
1744 ''' | 1744 ''' |
1745 m() { assert(false); } | 1745 m() { assert(m()); } |
1746 ''', | 1746 ''', |
1747 const Visit(VisitKind.VISIT_ASSERT, expression: 'false')), | 1747 const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_INVOKE, |
1748 const Test( | 1748 element: 'function(m)', |
1749 ''' | 1749 arguments: '()')), |
1750 m() { assert(); } | |
1751 ''', | |
1752 const Visit(VisitKind.ERROR_INVALID_ASSERT, arguments: '()')), | |
1753 const Test( | |
1754 ''' | |
1755 m() { assert(42, true); } | |
1756 ''', | |
1757 const Visit(VisitKind.ERROR_INVALID_ASSERT, arguments: '(42,true)')), | |
1758 ], | 1750 ], |
1759 'Logical and': const [ | 1751 'Logical and': const [ |
1760 // Logical and | 1752 // Logical and |
1761 const Test( | 1753 const Test( |
1762 ''' | 1754 ''' |
1763 m() => true && false; | 1755 m() => true && false; |
1764 ''', | 1756 ''', |
1765 const Visit(VisitKind.VISIT_LOGICAL_AND, left: 'true', right: 'false')), | 1757 const Visit(VisitKind.VISIT_LOGICAL_AND, left: 'true', right: 'false')), |
1766 ], | 1758 ], |
1767 'Logical or': const [ | 1759 'Logical or': const [ |
(...skipping 2691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4459 element: 'field(a)', rhs: '42')), | 4451 element: 'field(a)', rhs: '42')), |
4460 | 4452 |
4461 const Test( | 4453 const Test( |
4462 ''' | 4454 ''' |
4463 m() => unresolved ??= 42; | 4455 m() => unresolved ??= 42; |
4464 ''', | 4456 ''', |
4465 const Visit(VisitKind.VISIT_UNRESOLVED_SET_IF_NULL, | 4457 const Visit(VisitKind.VISIT_UNRESOLVED_SET_IF_NULL, |
4466 name: 'unresolved', rhs: '42')), | 4458 name: 'unresolved', rhs: '42')), |
4467 ], | 4459 ], |
4468 }; | 4460 }; |
OLD | NEW |