| 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 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 742 element: 'getter(o)')), | 742 element: 'getter(o)')), |
| 743 const Test.prefix( | 743 const Test.prefix( |
| 744 ''' | 744 ''' |
| 745 get o => null; | 745 get o => null; |
| 746 ''', | 746 ''', |
| 747 ''' | 747 ''' |
| 748 m() => p.o; | 748 m() => p.o; |
| 749 ''', | 749 ''', |
| 750 const Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_GET, | 750 const Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_GET, |
| 751 element: 'getter(o)')), | 751 element: 'getter(o)')), |
| 752 // TODO(johnniwinther): Expect [VISIT_TOP_LEVEL_SETTER_GET] instead. | |
| 753 const Test( | 752 const Test( |
| 754 ''' | 753 ''' |
| 755 set o(_) {} | 754 set o(_) {} |
| 756 m() => o; | 755 m() => o; |
| 757 ''', | 756 ''', |
| 758 const Visit(VisitKind.VISIT_TOP_LEVEL_SETTER_GET, | 757 const Visit(VisitKind.VISIT_TOP_LEVEL_SETTER_GET, |
| 759 element: 'setter(o)')), | 758 element: 'setter(o)')), |
| 760 const Test.prefix( | 759 const Test.prefix( |
| 761 ''' | 760 ''' |
| 762 set o(_) {} | 761 set o(_) {} |
| 763 ''', | 762 ''', |
| 764 ''' | 763 ''' |
| 765 m() => p.o; | 764 m() => p.o; |
| 766 ''', | 765 ''', |
| 767 const Visit(VisitKind.VISIT_UNRESOLVED_GET, | 766 const Visit(VisitKind.VISIT_TOP_LEVEL_SETTER_GET, |
| 768 name: 'o')), | 767 element: 'setter(o)')), |
| 769 // TODO(johnniwinther): Expect [VISIT_TOP_LEVEL_GETTER_SET] instead. | 768 // TODO(johnniwinther): Expect [VISIT_TOP_LEVEL_GETTER_SET] instead. |
| 770 const Test( | 769 const Test( |
| 771 ''' | 770 ''' |
| 772 get o => null; | 771 get o => null; |
| 773 m() { o = 42; } | 772 m() { o = 42; } |
| 774 ''', | 773 ''', |
| 775 const Visit(VisitKind.VISIT_UNRESOLVED_SET, | 774 const Visit(VisitKind.VISIT_UNRESOLVED_SET, |
| 776 name: 'o', | 775 name: 'o', |
| 777 rhs: '42')), | 776 rhs: '42')), |
| 778 const Test.prefix( | 777 const Test.prefix( |
| (...skipping 29 matching lines...) Expand all Loading... |
| 808 element: 'getter(o)', | 807 element: 'getter(o)', |
| 809 arguments: '(null,42)')), | 808 arguments: '(null,42)')), |
| 810 const Test.prefix( | 809 const Test.prefix( |
| 811 ''' | 810 ''' |
| 812 get o => null; | 811 get o => null; |
| 813 ''', | 812 ''', |
| 814 'm() { p.o(null, 42); }', | 813 'm() { p.o(null, 42); }', |
| 815 const Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_INVOKE, | 814 const Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_INVOKE, |
| 816 element: 'getter(o)', | 815 element: 'getter(o)', |
| 817 arguments: '(null,42)')), | 816 arguments: '(null,42)')), |
| 818 // TODO(johnniwinther): Expected [VISIT_TOP_LEVEL_SETTER_INVOKE] instead. | |
| 819 const Test( | 817 const Test( |
| 820 ''' | 818 ''' |
| 821 set o(_) {} | 819 set o(_) {} |
| 822 m() => o(null, 42); | 820 m() => o(null, 42); |
| 823 ''', | 821 ''', |
| 824 const Visit(VisitKind.VISIT_TOP_LEVEL_SETTER_INVOKE, | 822 const Visit(VisitKind.VISIT_TOP_LEVEL_SETTER_INVOKE, |
| 825 element: 'setter(o)', | 823 element: 'setter(o)', |
| 826 arguments: '(null,42)')), | 824 arguments: '(null,42)')), |
| 827 const Test.prefix( | 825 const Test.prefix( |
| 828 ''' | 826 ''' |
| 829 set o(_) {} | 827 set o(_) {} |
| 830 ''', | 828 ''', |
| 831 'm() { p.o(null, 42); }', | 829 'm() { p.o(null, 42); }', |
| 832 const Visit(VisitKind.VISIT_UNRESOLVED_INVOKE, | 830 const Visit(VisitKind.VISIT_TOP_LEVEL_SETTER_INVOKE, |
| 833 name: 'o', | 831 element: 'setter(o)', |
| 834 arguments: '(null,42)')), | 832 arguments: '(null,42)')), |
| 835 ], | 833 ], |
| 836 'Top level functions': const [ | 834 'Top level functions': const [ |
| 837 // Top level functions | 835 // Top level functions |
| 838 const Test( | 836 const Test( |
| 839 ''' | 837 ''' |
| 840 o(a, b) {} | 838 o(a, b) {} |
| 841 m() => o; | 839 m() => o; |
| 842 ''', | 840 ''', |
| 843 const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_GET, | 841 const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_GET, |
| (...skipping 2714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3558 ''' | 3556 ''' |
| 3559 m(a) => a ??= 42; | 3557 m(a) => a ??= 42; |
| 3560 ''', | 3558 ''', |
| 3561 const Visit( | 3559 const Visit( |
| 3562 VisitKind.VISIT_PARAMETER_COMPOUND, | 3560 VisitKind.VISIT_PARAMETER_COMPOUND, |
| 3563 element: 'parameter(m#a)', | 3561 element: 'parameter(m#a)', |
| 3564 operator: '??=', | 3562 operator: '??=', |
| 3565 rhs: '42')), | 3563 rhs: '42')), |
| 3566 ], | 3564 ], |
| 3567 }; | 3565 }; |
| OLD | NEW |