Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: tests/compiler/dart2js/semantic_visitor_test_send_data.dart

Issue 1842033004: Add *IndexSetIfNull methods to SemanticSendVisitor. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 2124 matching lines...) Expand 10 before | Expand all | Expand 10 after
2135 operator []=(a, b) {} 2135 operator []=(a, b) {}
2136 } 2136 }
2137 class C extends B { 2137 class C extends B {
2138 static m() => super[42]--; 2138 static m() => super[42]--;
2139 } 2139 }
2140 ''', 2140 ''',
2141 const Visit(VisitKind.ERROR_INVALID_INDEX_POSTFIX, 2141 const Visit(VisitKind.ERROR_INVALID_INDEX_POSTFIX,
2142 error: MessageKind.NO_SUPER_IN_STATIC, 2142 error: MessageKind.NO_SUPER_IN_STATIC,
2143 index: '42', 2143 index: '42',
2144 operator: '--')), 2144 operator: '--')),
2145 const Test(
2146 '''
2147 m() => [][42] ??= 0;
2148 ''',
2149 const Visit(VisitKind.VISIT_INDEX_SET_IF_NULL,
2150 receiver: '[] ',
2151 index: '42',
2152 rhs: '0')),
2153 const Test.clazz(
2154 '''
2155 class B {
2156 operator [](_) => null;
2157 operator []=(a, b) {}
2158 }
2159 class C extends B {
2160 m() => super[42] ??= 0;
2161 }
2162 ''',
2163 const Visit(VisitKind.VISIT_SUPER_INDEX_SET_IF_NULL,
2164 getter: 'function(B#[])',
2165 setter: 'function(B#[]=)',
2166 index: '42',
2167 rhs: '0')),
2168 const Test.clazz(
2169 '''
2170 class B {
2171 operator []=(a, b) {}
2172 }
2173 class C extends B {
2174 m() => super[42] ??= 0;
2175 }
2176 ''',
2177 const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_GETTER_INDEX_SET_IF_NULL,
2178 setter: 'function(B#[]=)',
2179 index: '42',
2180 rhs: '0')),
2181 const Test.clazz(
2182 '''
2183 class B {
2184 operator [](_) => null;
2185 }
2186 class C extends B {
2187 m() => super[42] ??= 0;
2188 }
2189 ''',
2190 const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_SETTER_INDEX_SET_IF_NULL,
2191 getter: 'function(B#[])',
2192 index: '42',
2193 rhs: '0')),
2194 const Test.clazz(
2195 '''
2196 class B {
2197 }
2198 class C extends B {
2199 m() => super[42] ??= 0;
2200 }
2201 ''',
2202 const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_INDEX_SET_IF_NULL,
2203 index: '42',
2204 rhs: '0')),
2145 ], 2205 ],
2146 'Equals': const [ 2206 'Equals': const [
2147 // Equals 2207 // Equals
2148 const Test( 2208 const Test(
2149 ''' 2209 '''
2150 m() => 2 == 3; 2210 m() => 2 == 3;
2151 ''', 2211 ''',
2152 const Visit(VisitKind.VISIT_EQUALS, 2212 const Visit(VisitKind.VISIT_EQUALS,
2153 left: '2', right: '3')), 2213 left: '2', right: '3')),
2154 const Test.clazz( 2214 const Test.clazz(
(...skipping 2357 matching lines...) Expand 10 before | Expand all | Expand 10 after
4512 element: 'field(a)', rhs: '42')), 4572 element: 'field(a)', rhs: '42')),
4513 4573
4514 const Test( 4574 const Test(
4515 ''' 4575 '''
4516 m() => unresolved ??= 42; 4576 m() => unresolved ??= 42;
4517 ''', 4577 ''',
4518 const Visit(VisitKind.VISIT_UNRESOLVED_SET_IF_NULL, 4578 const Visit(VisitKind.VISIT_UNRESOLVED_SET_IF_NULL,
4519 name: 'unresolved', rhs: '42')), 4579 name: 'unresolved', rhs: '42')),
4520 ], 4580 ],
4521 }; 4581 };
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/semantic_visitor_test.dart ('k') | tests/compiler/dart2js/semantic_visitor_test_send_visitor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698