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

Side by Side Diff: tests/compiler/dart2js/no_such_method_enabled_test.dart

Issue 2935663002: Remove Compiler.commonElements (Closed)
Patch Set: Remove Compiler._commonElements Created 3 years, 6 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
« no previous file with comments | « tests/compiler/dart2js/mock_compiler.dart ('k') | tests/compiler/dart2js/patch_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/mock_compiler.dart ('k') | tests/compiler/dart2js/patch_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698