| OLD | NEW |
| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 typedef Typedef(); |
| 81 |
| 80 main() { | 82 main() { |
| 81 foo(); | 83 foo(); |
| 82 bar(true); | 84 bar(true); |
| 83 []; | 85 []; |
| 84 <int>[]; | 86 <int>[]; |
| 85 {}; | 87 {}; |
| 86 new Object(); | 88 new Object(); |
| 87 new Class.named(''); | 89 new Class.named(''); |
| 88 new SubClass().method(); | 90 new SubClass().method(); |
| 89 Class.staticField; | 91 Class.staticField; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 x = toplevel; | 132 x = toplevel; |
| 131 x = testIs(x); | 133 x = testIs(x); |
| 132 x = new Generic<int>().method(x); | 134 x = new Generic<int>().method(x); |
| 133 x = testAsGeneric(x); | 135 x = testAsGeneric(x); |
| 134 x = testAsFunction(x); | 136 x = testAsFunction(x); |
| 135 print(x); | 137 print(x); |
| 136 var f = (x) { | 138 var f = (x) { |
| 137 return 400 + x; | 139 return 400 + x; |
| 138 }; | 140 }; |
| 139 x = f(x); | 141 x = f(x); |
| 142 x = Object; |
| 143 x = Typedef; |
| 140 return x; | 144 return x; |
| 141 } | 145 } |
| 142 typedef NoArg(); | 146 typedef NoArg(); |
| 143 @NoInline() | 147 @NoInline() |
| 144 testIs(o) => o is Generic<int> || o is NoArg; | 148 testIs(o) => o is Generic<int> || o is NoArg; |
| 145 @NoInline() | 149 @NoInline() |
| 146 testAsGeneric(o) => o as Generic<int>; | 150 testAsGeneric(o) => o as Generic<int>; |
| 147 @NoInline() | 151 @NoInline() |
| 148 testAsFunction(o) => o as NoArg; | 152 testAsFunction(o) => o as NoArg; |
| 149 ''' | 153 ''' |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 Map<String, BufferedOutputSink> map2 = collector2.outputMap[outputType]; | 369 Map<String, BufferedOutputSink> map2 = collector2.outputMap[outputType]; |
| 366 checkSets(map1.keys, map2.keys, 'output', equality); | 370 checkSets(map1.keys, map2.keys, 'output', equality); |
| 367 map1.forEach((String name, BufferedOutputSink output1) { | 371 map1.forEach((String name, BufferedOutputSink output1) { |
| 368 BufferedOutputSink output2 = map2[name]; | 372 BufferedOutputSink output2 = map2[name]; |
| 369 Expect.stringEquals(output1.text, output2.text); | 373 Expect.stringEquals(output1.text, output2.text); |
| 370 }); | 374 }); |
| 371 }); | 375 }); |
| 372 } | 376 } |
| 373 return ResultKind.success; | 377 return ResultKind.success; |
| 374 } | 378 } |
| OLD | NEW |