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

Side by Side Diff: tests/compiler/dart2js/kernel/constructors_test.dart

Issue 2997413002: Support --use-kernel in memory_compiler (Closed)
Patch Set: Remove hack in source_loader Created 3 years, 3 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
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 'package:compiler/src/common_elements.dart';
5 import 'package:compiler/src/compiler.dart' show Compiler; 6 import 'package:compiler/src/compiler.dart' show Compiler;
6 import 'package:compiler/src/elements/elements.dart'; 7 import 'package:compiler/src/elements/entities.dart';
7 import 'package:test/test.dart'; 8 import 'package:test/test.dart';
8 9
9 import 'helper.dart' show check; 10 import 'helper.dart' show check;
10 11
11 main() { 12 main() {
12 test('simple default constructor', () { 13 test('simple default constructor', () {
13 String code = ''' 14 String code = '''
14 class A { 15 class A {
15 } 16 }
16 17
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 } 64 }
64 } 65 }
65 66
66 main() => new Foo(); 67 main() => new Foo();
67 '''; 68 ''';
68 return check(code, lookup: defaultConstructorFor('Foo')); 69 return check(code, lookup: defaultConstructorFor('Foo'));
69 });*/ 70 });*/
70 } 71 }
71 72
72 defaultConstructorFor(String className) => (Compiler compiler) { 73 defaultConstructorFor(String className) => (Compiler compiler) {
73 LibraryElement mainApp = 74 ElementEnvironment elementEnvironment =
74 compiler.frontendStrategy.elementEnvironment.mainLibrary; 75 compiler.backendClosedWorldForTesting.elementEnvironment;
75 ClassElement clazz = mainApp.find(className); 76 LibraryEntity mainLibrary = elementEnvironment.mainLibrary;
76 return clazz.lookupDefaultConstructor(); 77 ClassEntity clazz =
78 elementEnvironment.lookupClass(mainLibrary, className);
79 return elementEnvironment.lookupConstructor(clazz, '');
77 }; 80 };
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/kernel/class_hierarchy_test.dart ('k') | tests/compiler/dart2js/kernel/getters_setters_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698