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 import 'dart:async'; | 5 import 'dart:async'; |
6 import 'package:async_helper/async_helper.dart'; | 6 import 'package:async_helper/async_helper.dart'; |
7 import 'package:compiler/src/common_elements.dart'; | 7 import 'package:compiler/src/common_elements.dart'; |
8 import 'package:compiler/src/compiler.dart'; | 8 import 'package:compiler/src/compiler.dart'; |
9 import 'package:compiler/src/elements/entities.dart'; | 9 import 'package:compiler/src/elements/entities.dart'; |
10 import 'package:compiler/src/js_backend/no_such_method_registry.dart'; | 10 import 'package:compiler/src/js_backend/no_such_method_registry.dart'; |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 checkTest(compiler, TESTS[index], testComplexReturns: false); | 265 checkTest(compiler, TESTS[index], testComplexReturns: false); |
266 } | 266 } |
267 }); | 267 }); |
268 } | 268 } |
269 | 269 |
270 checkTest(Compiler compiler, NoSuchMethodTest test, {bool testComplexReturns}) { | 270 checkTest(Compiler compiler, NoSuchMethodTest test, {bool testComplexReturns}) { |
271 ElementEnvironment elementEnvironment = compiler.elementEnvironment; | 271 ElementEnvironment elementEnvironment = compiler.elementEnvironment; |
272 NoSuchMethodRegistry registry = compiler.backend.noSuchMethodRegistry; | 272 NoSuchMethodRegistry registry = compiler.backend.noSuchMethodRegistry; |
273 NoSuchMethodResolver resolver = registry.internalResolverForTesting; | 273 NoSuchMethodResolver resolver = registry.internalResolverForTesting; |
274 FunctionEntity ObjectNSM = elementEnvironment.lookupClassMember( | 274 FunctionEntity ObjectNSM = elementEnvironment.lookupClassMember( |
275 compiler.commonElements.objectClass, 'noSuchMethod'); | 275 compiler.resolution.commonElements.objectClass, 'noSuchMethod'); |
276 ClosedWorld closedWorld = | 276 ClosedWorld closedWorld = |
277 compiler.resolutionWorldBuilder.closedWorldForTesting; | 277 compiler.resolutionWorldBuilder.closedWorldForTesting; |
278 | 278 |
279 // Test [NoSuchMethodResolver] results for each method. | 279 // Test [NoSuchMethodResolver] results for each method. |
280 for (NoSuchMethodInfo info in test.methods) { | 280 for (NoSuchMethodInfo info in test.methods) { |
281 ClassEntity cls = | 281 ClassEntity cls = |
282 elementEnvironment.lookupClass(compiler.mainApp, info.className); | 282 elementEnvironment.lookupClass(compiler.mainApp, info.className); |
283 Expect.isNotNull(cls, "Class ${info.className} not found."); | 283 Expect.isNotNull(cls, "Class ${info.className} not found."); |
284 FunctionEntity noSuchMethod = | 284 FunctionEntity noSuchMethod = |
285 elementEnvironment.lookupClassMember(cls, 'noSuchMethod'); | 285 elementEnvironment.lookupClassMember(cls, 'noSuchMethod'); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 registry.complexReturningImpls.contains(noSuchMethod), | 345 registry.complexReturningImpls.contains(noSuchMethod), |
346 "Unexpected isComplexReturn result on $noSuchMethod."); | 346 "Unexpected isComplexReturn result on $noSuchMethod."); |
347 } | 347 } |
348 } | 348 } |
349 | 349 |
350 Expect.equals( | 350 Expect.equals( |
351 test.isNoSuchMethodUsed, | 351 test.isNoSuchMethodUsed, |
352 closedWorld.backendUsage.isNoSuchMethodUsed, | 352 closedWorld.backendUsage.isNoSuchMethodUsed, |
353 "Unexpected isNoSuchMethodUsed result."); | 353 "Unexpected isNoSuchMethodUsed result."); |
354 } | 354 } |
OLD | NEW |