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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 element: 'field(C#o)')), | 100 element: 'field(C#o)')), |
101 const Test.prefix( | 101 const Test.prefix( |
102 ''' | 102 ''' |
103 class C { | 103 class C { |
104 static var o; | 104 static var o; |
105 } | 105 } |
106 ''', | 106 ''', |
107 'm() => p.C.o;', | 107 'm() => p.C.o;', |
108 const Visit(VisitKind.VISIT_STATIC_FIELD_GET, | 108 const Visit(VisitKind.VISIT_STATIC_FIELD_GET, |
109 element: 'field(C#o)')), | 109 element: 'field(C#o)')), |
| 110 const Test.prefix( |
| 111 ''' |
| 112 class C { |
| 113 static var o; |
| 114 } |
| 115 ''', |
| 116 'm() => p.C.o;', |
| 117 const [ |
| 118 const Visit(VisitKind.PREVISIT_DEFERRED_ACCESS, |
| 119 element: 'prefix(p)'), |
| 120 const Visit(VisitKind.VISIT_STATIC_FIELD_GET, |
| 121 element: 'field(C#o)'), |
| 122 ], |
| 123 isDeferred: true), |
110 const Test( | 124 const Test( |
111 ''' | 125 ''' |
112 class C { | 126 class C { |
113 var o; | 127 var o; |
114 } | 128 } |
115 m() => C.o; | 129 m() => C.o; |
116 ''', | 130 ''', |
117 const Visit(VisitKind.VISIT_UNRESOLVED_GET, | 131 const Visit(VisitKind.VISIT_UNRESOLVED_GET, |
118 name: 'o')), | 132 name: 'o')), |
119 const Test( | 133 const Test( |
120 ''' | 134 ''' |
121 class C { | 135 class C { |
122 C.o(); | 136 C.o(); |
123 } | 137 } |
124 m() => C.o; | 138 m() => C.o; |
125 ''', | 139 ''', |
126 const Visit(VisitKind.VISIT_UNRESOLVED_GET, | 140 const Visit(VisitKind.VISIT_UNRESOLVED_GET, |
127 name: 'o')), | 141 name: 'o')), |
| 142 const Test.prefix( |
| 143 ''' |
| 144 ''', |
| 145 'm() => p.C.o;', |
| 146 const [ |
| 147 const Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_GET, |
| 148 receiver: 'p.C', name: 'o'), |
| 149 const Visit(VisitKind.VISIT_UNRESOLVED_GET, name: 'C'), |
| 150 ]), |
| 151 const Test.prefix( |
| 152 ''' |
| 153 class C { |
| 154 } |
| 155 ''', |
| 156 'm() => p.C.o;', |
| 157 const Visit(VisitKind.VISIT_UNRESOLVED_GET, name: 'o')), |
| 158 const Test.prefix( |
| 159 ''' |
| 160 ''', |
| 161 'm() => p.C.o;', |
| 162 const [ |
| 163 const Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_GET, |
| 164 receiver: 'p.C', name: 'o'), |
| 165 const Visit(VisitKind.PREVISIT_DEFERRED_ACCESS, |
| 166 element: 'prefix(p)'), |
| 167 const Visit(VisitKind.VISIT_UNRESOLVED_GET, |
| 168 name: 'C'), |
| 169 ], |
| 170 isDeferred: true), |
| 171 const Test.prefix( |
| 172 ''' |
| 173 class C { |
| 174 } |
| 175 ''', |
| 176 'm() => p.C.o;', |
| 177 const [ |
| 178 const Visit(VisitKind.PREVISIT_DEFERRED_ACCESS, |
| 179 element: 'prefix(p)'), |
| 180 const Visit(VisitKind.VISIT_UNRESOLVED_GET, |
| 181 name: 'o'), |
| 182 ], |
| 183 isDeferred: true), |
128 const Test( | 184 const Test( |
129 ''' | 185 ''' |
130 class C {} | 186 class C {} |
131 m() => C.this; | 187 m() => C.this; |
132 ''', | 188 ''', |
133 null), | 189 null), |
134 const Test( | 190 const Test( |
135 ''' | 191 ''' |
136 class C { static var o; } | 192 class C { static var o; } |
137 m() { C.o = 42; } | 193 m() { C.o = 42; } |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 ''', | 708 ''', |
653 const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_GET, | 709 const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_GET, |
654 element: 'field(o)')), | 710 element: 'field(o)')), |
655 const Test.prefix( | 711 const Test.prefix( |
656 ''' | 712 ''' |
657 var o; | 713 var o; |
658 ''', | 714 ''', |
659 'm() => p.o;', | 715 'm() => p.o;', |
660 const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_GET, | 716 const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_GET, |
661 element: 'field(o)')), | 717 element: 'field(o)')), |
| 718 const Test.prefix( |
| 719 ''' |
| 720 var o; |
| 721 ''', |
| 722 'm() => p.o;', |
| 723 const [ |
| 724 const Visit(VisitKind.PREVISIT_DEFERRED_ACCESS, |
| 725 element: 'prefix(p)'), |
| 726 const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_GET, |
| 727 element: 'field(o)'), |
| 728 ], |
| 729 isDeferred: true), |
| 730 const Test.prefix( |
| 731 ''' |
| 732 ''', |
| 733 'm() => p.o;', |
| 734 const Visit(VisitKind.VISIT_UNRESOLVED_GET, |
| 735 name: 'o')), |
| 736 const Test.prefix( |
| 737 ''' |
| 738 ''', |
| 739 'm() => p.o;', |
| 740 const [ |
| 741 const Visit(VisitKind.PREVISIT_DEFERRED_ACCESS, |
| 742 element: 'prefix(p)'), |
| 743 const Visit(VisitKind.VISIT_UNRESOLVED_GET, |
| 744 name: 'o'), |
| 745 ], |
| 746 isDeferred: true), |
662 const Test( | 747 const Test( |
663 ''' | 748 ''' |
664 var o; | 749 var o; |
665 m() { o = 42; } | 750 m() { o = 42; } |
666 ''', | 751 ''', |
667 const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_SET, | 752 const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_SET, |
668 element: 'field(o)', | 753 element: 'field(o)', |
669 rhs: '42')), | 754 rhs: '42')), |
670 const Test.prefix( | 755 const Test.prefix( |
671 ''' | 756 ''' |
(...skipping 2884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3556 ''' | 3641 ''' |
3557 m(a) => a ??= 42; | 3642 m(a) => a ??= 42; |
3558 ''', | 3643 ''', |
3559 const Visit( | 3644 const Visit( |
3560 VisitKind.VISIT_PARAMETER_COMPOUND, | 3645 VisitKind.VISIT_PARAMETER_COMPOUND, |
3561 element: 'parameter(m#a)', | 3646 element: 'parameter(m#a)', |
3562 operator: '??=', | 3647 operator: '??=', |
3563 rhs: '42')), | 3648 rhs: '42')), |
3564 ], | 3649 ], |
3565 }; | 3650 }; |
OLD | NEW |