| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 import 'package:expect/expect.dart'; | 6 import 'package:expect/expect.dart'; |
| 7 import 'package:async_helper/async_helper.dart'; | 7 import 'package:async_helper/async_helper.dart'; |
| 8 import 'package:compiler/src/compiler.dart'; | 8 import 'package:compiler/src/compiler.dart'; |
| 9 import 'package:compiler/src/diagnostics/messages.dart' show MessageKind; | 9 import 'package:compiler/src/diagnostics/messages.dart' show MessageKind; |
| 10 import 'package:compiler/src/elements/elements.dart'; | 10 import 'package:compiler/src/elements/elements.dart'; |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 expectIsPatched: expectIsPatched, checkHasBody: true); | 193 expectIsPatched: expectIsPatched, checkHasBody: true); |
| 194 if (expectIsPatched) { | 194 if (expectIsPatched) { |
| 195 AstElement patch = ensure( | 195 AstElement patch = ensure( |
| 196 compiler, "test", compiler.commonElements.coreLibrary.patch.find, | 196 compiler, "test", compiler.commonElements.coreLibrary.patch.find, |
| 197 expectIsPatch: true, checkHasBody: true); | 197 expectIsPatch: true, checkHasBody: true); |
| 198 Expect.equals(origin.patch, patch); | 198 Expect.equals(origin.patch, patch); |
| 199 Expect.equals(patch.origin, origin); | 199 Expect.equals(patch.origin, origin); |
| 200 Expect.equals(patchText, patch.node.toString()); | 200 Expect.equals(patchText, patch.node.toString()); |
| 201 } | 201 } |
| 202 | 202 |
| 203 compiler.analyzeElement(origin); | 203 compiler.resolution.computeWorldImpact(origin); |
| 204 compiler.enqueuer.resolution.emptyDeferredQueueForTesting(); | 204 compiler.enqueuer.resolution.emptyDeferredQueueForTesting(); |
| 205 | 205 |
| 206 DiagnosticCollector collector = compiler.diagnosticCollector; | 206 DiagnosticCollector collector = compiler.diagnosticCollector; |
| 207 Expect.isTrue(collector.warnings.isEmpty, | 207 Expect.isTrue(collector.warnings.isEmpty, |
| 208 "Unexpected warnings: ${collector.warnings}"); | 208 "Unexpected warnings: ${collector.warnings}"); |
| 209 if (expectedError != null) { | 209 if (expectedError != null) { |
| 210 Expect.equals(expectedError, collector.errors.first.message.toString()); | 210 Expect.equals(expectedError, collector.errors.first.message.toString()); |
| 211 } else { | 211 } else { |
| 212 Expect.isTrue( | 212 Expect.isTrue( |
| 213 collector.errors.isEmpty, "Unexpected errors: ${collector.errors}"); | 213 collector.errors.isEmpty, "Unexpected errors: ${collector.errors}"); |
| (...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1116 await testPatchNonFunction(); | 1116 await testPatchNonFunction(); |
| 1117 | 1117 |
| 1118 await testPatchAndSelector(); | 1118 await testPatchAndSelector(); |
| 1119 | 1119 |
| 1120 await testEffectiveTarget(); | 1120 await testEffectiveTarget(); |
| 1121 | 1121 |
| 1122 await testAnalyzeAllInjectedMembers(); | 1122 await testAnalyzeAllInjectedMembers(); |
| 1123 await testTypecheckPatchedMembers(); | 1123 await testTypecheckPatchedMembers(); |
| 1124 }); | 1124 }); |
| 1125 } | 1125 } |
| OLD | NEW |