| 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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 print(sources[index]); | 261 print(sources[index]); |
| 262 Compiler compiler = await results[index](); | 262 Compiler compiler = await results[index](); |
| 263 compiler.resolutionWorldBuilder.closeWorld(); | 263 compiler.resolutionWorldBuilder.closeWorld(); |
| 264 // Complex returns are computed during inference. | 264 // Complex returns are computed during inference. |
| 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 = |
| 272 compiler.frontendStrategy.elementEnvironment; |
| 272 NoSuchMethodRegistry registry = compiler.backend.noSuchMethodRegistry; | 273 NoSuchMethodRegistry registry = compiler.backend.noSuchMethodRegistry; |
| 273 NoSuchMethodResolver resolver = registry.internalResolverForTesting; | 274 NoSuchMethodResolver resolver = registry.internalResolverForTesting; |
| 274 FunctionEntity ObjectNSM = elementEnvironment.lookupClassMember( | 275 FunctionEntity ObjectNSM = elementEnvironment.lookupClassMember( |
| 275 compiler.resolution.commonElements.objectClass, 'noSuchMethod'); | 276 compiler.frontendStrategy.commonElements.objectClass, 'noSuchMethod'); |
| 276 ClosedWorld closedWorld = | 277 ClosedWorld closedWorld = |
| 277 compiler.resolutionWorldBuilder.closedWorldForTesting; | 278 compiler.resolutionWorldBuilder.closedWorldForTesting; |
| 278 | 279 |
| 279 // Test [NoSuchMethodResolver] results for each method. | 280 // Test [NoSuchMethodResolver] results for each method. |
| 280 for (NoSuchMethodInfo info in test.methods) { | 281 for (NoSuchMethodInfo info in test.methods) { |
| 281 ClassEntity cls = | 282 ClassEntity cls = |
| 282 elementEnvironment.lookupClass(compiler.mainApp, info.className); | 283 elementEnvironment.lookupClass(compiler.mainApp, info.className); |
| 283 Expect.isNotNull(cls, "Class ${info.className} not found."); | 284 Expect.isNotNull(cls, "Class ${info.className} not found."); |
| 284 FunctionEntity noSuchMethod = | 285 FunctionEntity noSuchMethod = |
| 285 elementEnvironment.lookupClassMember(cls, 'noSuchMethod'); | 286 elementEnvironment.lookupClassMember(cls, 'noSuchMethod'); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 registry.complexReturningImpls.contains(noSuchMethod), | 346 registry.complexReturningImpls.contains(noSuchMethod), |
| 346 "Unexpected isComplexReturn result on $noSuchMethod."); | 347 "Unexpected isComplexReturn result on $noSuchMethod."); |
| 347 } | 348 } |
| 348 } | 349 } |
| 349 | 350 |
| 350 Expect.equals( | 351 Expect.equals( |
| 351 test.isNoSuchMethodUsed, | 352 test.isNoSuchMethodUsed, |
| 352 closedWorld.backendUsage.isNoSuchMethodUsed, | 353 closedWorld.backendUsage.isNoSuchMethodUsed, |
| 353 "Unexpected isNoSuchMethodUsed result."); | 354 "Unexpected isNoSuchMethodUsed result."); |
| 354 } | 355 } |
| OLD | NEW |