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

Side by Side Diff: tests/compiler/dart2js/kernel/compile_from_dill_test_helper.dart

Issue 2992763002: Add boxed fields in closure classes. (Closed)
Patch Set: . Created 3 years, 4 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) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 // Helper to test compilation equivalence between source and .dill based 5 // Helper to test compilation equivalence between source and .dill based
6 // compilation. 6 // compilation.
7 library dart2js.kernel.compile_from_dill_test_helper; 7 library dart2js.kernel.compile_from_dill_test_helper;
8 8
9 import 'dart:async'; 9 import 'dart:async';
10 10
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 foo({named}) => 1; 54 foo({named}) => 1;
55 bar(a) => !a; 55 bar(a) => !a;
56 class Class { 56 class Class {
57 var field; 57 var field;
58 static var staticField; 58 static var staticField;
59 59
60 Class(); 60 Class();
61 Class.named(this.field) { 61 Class.named(this.field) {
62 staticField = 42; 62 staticField = 42;
63 } 63 }
64 64
65 method() {} 65 method() {}
66 } 66 }
67 67
68 class SubClass extends Class { 68 class SubClass extends Class {
69 method() { 69 method() {
70 super.method(); 70 super.method();
71 } 71 }
72 } 72 }
73 73
74 class Generic<T> { 74 class Generic<T> {
75 method(o) => o is T; 75 method(o) => o is T;
76 } 76 }
77 77
78 var toplevel; 78 var toplevel;
79 79
80 main() { 80 main() {
81 foo(); 81 foo();
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 typedef NoArg(); 138 typedef NoArg();
139 @NoInline() 139 @NoInline()
140 testIs(o) => o is Generic<int> || o is NoArg; 140 testIs(o) => o is Generic<int> || o is NoArg;
141 @NoInline() 141 @NoInline()
142 testAsGeneric(o) => o as Generic<int>; 142 testAsGeneric(o) => o as Generic<int>;
143 @NoInline() 143 @NoInline()
144 testAsFunction(o) => o as NoArg; 144 testAsFunction(o) => o as NoArg;
145 ''' 145 '''
146 }), 146 }),
147 const Test(const { 147 const Test(const {
148 'main.dart': ''' 148 'main.dart': '''
149 149
150 main() { 150 main() {
151 var x; 151 var x;
152 int i = 0; 152 int i = 0;
153 do { 153 do {
154 if (i == 5) continue; 154 if (i == 5) continue;
155 x = i; 155 x = i;
156 if (i == 7) break; 156 if (i == 7) break;
157 i++; 157 i++;
158 } while (i < 10); 158 } while (i < 10);
159 print(x); 159 print(x);
160 } 160 }
161 ''' 161 '''
162 }, expectIdenticalOutput: false), 162 }, expectIdenticalOutput: false),
163 const Test(const { 163 const Test(const {
164 'main.dart': ''' 164 'main.dart': '''
165 class A<U,V> { 165 class A<U,V> {
166 var a = U; 166 var a = U;
167 var b = V; 167 var b = V;
168 } 168 }
169 class B<Q, R> extends A<R, W<Q>> { 169 class B<Q, R> extends A<R, W<Q>> {
170 } 170 }
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 Map<String, BufferedOutputSink> map2 = collector2.outputMap[outputType]; 359 Map<String, BufferedOutputSink> map2 = collector2.outputMap[outputType];
360 checkSets(map1.keys, map2.keys, 'output', equality); 360 checkSets(map1.keys, map2.keys, 'output', equality);
361 map1.forEach((String name, BufferedOutputSink output1) { 361 map1.forEach((String name, BufferedOutputSink output1) {
362 BufferedOutputSink output2 = map2[name]; 362 BufferedOutputSink output2 = map2[name];
363 Expect.stringEquals(output1.text, output2.text); 363 Expect.stringEquals(output1.text, output2.text);
364 }); 364 });
365 }); 365 });
366 } 366 }
367 return ResultKind.success; 367 return ResultKind.success;
368 } 368 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698