| 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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 ''', | 261 ''', |
| 262 'm() { p.C.o(null, 42); }', | 262 'm() { p.C.o(null, 42); }', |
| 263 const Visit(VisitKind.VISIT_STATIC_FIELD_INVOKE, | 263 const Visit(VisitKind.VISIT_STATIC_FIELD_INVOKE, |
| 264 element: 'field(C#o)', | 264 element: 'field(C#o)', |
| 265 arguments: '(null,42)')), | 265 arguments: '(null,42)')), |
| 266 const Test( | 266 const Test( |
| 267 ''' | 267 ''' |
| 268 class C {} | 268 class C {} |
| 269 m() => C.this(null, 42); | 269 m() => C.this(null, 42); |
| 270 ''', | 270 ''', |
| 271 const Visit(VisitKind.VISIT_UNRESOLVED_INVOKE, | 271 const Visit(VisitKind.ERROR_INVALID_INVOKE, |
| 272 name: 'this', arguments: '(null,42)')), | 272 error: MessageKind.THIS_PROPERTY, arguments: '(null,42)')), |
| 273 // TODO(johnniwinther): Expect [VISIT_FINAL_STATIC_FIELD_SET] instead. | 273 // TODO(johnniwinther): Expect [VISIT_FINAL_STATIC_FIELD_SET] instead. |
| 274 const Test( | 274 const Test( |
| 275 ''' | 275 ''' |
| 276 class C { static final o = 0; } | 276 class C { static final o = 0; } |
| 277 m() { C.o = 42; } | 277 m() { C.o = 42; } |
| 278 ''', | 278 ''', |
| 279 const Visit(VisitKind.VISIT_UNRESOLVED_SET, | 279 const Visit(VisitKind.VISIT_UNRESOLVED_SET, |
| 280 name: 'o', | 280 name: 'o', |
| 281 rhs: '42')), | 281 rhs: '42')), |
| 282 const Test.clazz( | 282 const Test.clazz( |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 ''' | 737 ''' |
| 738 ''', | 738 ''', |
| 739 'm() => p.o;', | 739 'm() => p.o;', |
| 740 const [ | 740 const [ |
| 741 const Visit(VisitKind.PREVISIT_DEFERRED_ACCESS, | 741 const Visit(VisitKind.PREVISIT_DEFERRED_ACCESS, |
| 742 element: 'prefix(p)'), | 742 element: 'prefix(p)'), |
| 743 const Visit(VisitKind.VISIT_UNRESOLVED_GET, | 743 const Visit(VisitKind.VISIT_UNRESOLVED_GET, |
| 744 name: 'o'), | 744 name: 'o'), |
| 745 ], | 745 ], |
| 746 isDeferred: true), | 746 isDeferred: true), |
| 747 const Test.prefix( |
| 748 ''' |
| 749 ''', |
| 750 'm() => p;', |
| 751 const Visit(VisitKind.ERROR_INVALID_GET, |
| 752 error: MessageKind.PREFIX_AS_EXPRESSION)), |
| 747 const Test( | 753 const Test( |
| 748 ''' | 754 ''' |
| 749 var o; | 755 var o; |
| 750 m() { o = 42; } | 756 m() { o = 42; } |
| 751 ''', | 757 ''', |
| 752 const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_SET, | 758 const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_SET, |
| 753 element: 'field(o)', | 759 element: 'field(o)', |
| 754 rhs: '42')), | 760 rhs: '42')), |
| 755 const Test.prefix( | 761 const Test.prefix( |
| 756 ''' | 762 ''' |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 949 const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_INVOKE, | 955 const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_INVOKE, |
| 950 element: 'function(o)', | 956 element: 'function(o)', |
| 951 arguments: '(null,42)')), | 957 arguments: '(null,42)')), |
| 952 const Test( | 958 const Test( |
| 953 ''' | 959 ''' |
| 954 m() => o(null, 42); | 960 m() => o(null, 42); |
| 955 ''', | 961 ''', |
| 956 const Visit(VisitKind.VISIT_UNRESOLVED_INVOKE, | 962 const Visit(VisitKind.VISIT_UNRESOLVED_INVOKE, |
| 957 name: 'o', | 963 name: 'o', |
| 958 arguments: '(null,42)')), | 964 arguments: '(null,42)')), |
| 965 const Test.prefix( |
| 966 ''' |
| 967 o(a, b) {} |
| 968 ''', |
| 969 'm() => p.o(null, 42);', |
| 970 const [ |
| 971 const Visit(VisitKind.PREVISIT_DEFERRED_ACCESS, |
| 972 element: 'prefix(p)'), |
| 973 const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_INVOKE, |
| 974 element: 'function(o)', |
| 975 arguments: '(null,42)'), |
| 976 ], |
| 977 isDeferred: true), |
| 978 const Test.prefix( |
| 979 ''' |
| 980 ''', |
| 981 'm() => p.o(null, 42);', |
| 982 const Visit(VisitKind.VISIT_UNRESOLVED_INVOKE, |
| 983 name: 'o', |
| 984 arguments: '(null,42)')), |
| 985 const Test.prefix( |
| 986 ''' |
| 987 ''', |
| 988 'm() => p.o(null, 42);', |
| 989 const [ |
| 990 const Visit(VisitKind.PREVISIT_DEFERRED_ACCESS, |
| 991 element: 'prefix(p)'), |
| 992 const Visit(VisitKind.VISIT_UNRESOLVED_INVOKE, |
| 993 name: 'o', |
| 994 arguments: '(null,42)'), |
| 995 ], |
| 996 isDeferred: true), |
| 997 const Test.prefix( |
| 998 ''' |
| 999 ''', |
| 1000 'm() => p(null, 42);', |
| 1001 const Visit(VisitKind.ERROR_INVALID_INVOKE, |
| 1002 error: MessageKind.PREFIX_AS_EXPRESSION, |
| 1003 arguments: '(null,42)')), |
| 959 // TODO(johnniwinther): Expect [VISIT_TOP_LEVEL_FUNCTION_SET] instead. | 1004 // TODO(johnniwinther): Expect [VISIT_TOP_LEVEL_FUNCTION_SET] instead. |
| 960 const Test( | 1005 const Test( |
| 961 ''' | 1006 ''' |
| 962 o(a, b) {} | 1007 o(a, b) {} |
| 963 m() { o = 42; } | 1008 m() { o = 42; } |
| 964 ''', | 1009 ''', |
| 965 const Visit(VisitKind.VISIT_UNRESOLVED_SET, | 1010 const Visit(VisitKind.VISIT_UNRESOLVED_SET, |
| 966 name: 'o', | 1011 name: 'o', |
| 967 rhs: '42')), | 1012 rhs: '42')), |
| 968 const Test.prefix( | 1013 const Test.prefix( |
| (...skipping 2672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3641 ''' | 3686 ''' |
| 3642 m(a) => a ??= 42; | 3687 m(a) => a ??= 42; |
| 3643 ''', | 3688 ''', |
| 3644 const Visit( | 3689 const Visit( |
| 3645 VisitKind.VISIT_PARAMETER_COMPOUND, | 3690 VisitKind.VISIT_PARAMETER_COMPOUND, |
| 3646 element: 'parameter(m#a)', | 3691 element: 'parameter(m#a)', |
| 3647 operator: '??=', | 3692 operator: '??=', |
| 3648 rhs: '42')), | 3693 rhs: '42')), |
| 3649 ], | 3694 ], |
| 3650 }; | 3695 }; |
| OLD | NEW |