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

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

Issue 2989453002: Add support for compiling Dart via the FE in dart2js. (Closed)
Patch Set: update status Created 3 years, 4 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 /// Test that the dart2js copy of [KernelVisitor] generates the expected class 5 /// Test that the dart2js copy of [KernelVisitor] generates the expected class
6 /// hierarchy. 6 /// hierarchy.
7 7
8 import 'package:compiler/src/commandline_options.dart' show Flags; 8 import 'package:compiler/src/commandline_options.dart' show Flags;
9 import 'package:compiler/src/compiler.dart' show Compiler; 9 import 'package:compiler/src/compiler.dart' show Compiler;
10 import 'package:compiler/src/js_backend/backend.dart' show JavaScriptBackend; 10 import 'package:compiler/src/js_backend/backend.dart' show JavaScriptBackend;
(...skipping 14 matching lines...) Expand all
25 mMethod() {} 25 mMethod() {}
26 } 26 }
27 class C extends S with M { 27 class C extends S with M {
28 cMethod() {} 28 cMethod() {}
29 } 29 }
30 main() {} 30 main() {}
31 ''' 31 '''
32 }, options: [ 32 }, options: [
33 Flags.analyzeOnly, 33 Flags.analyzeOnly,
34 Flags.analyzeAll, 34 Flags.analyzeAll,
35 Flags.useKernel 35 Flags.useKernelInSsa
36 ]); 36 ]);
37 test('mixin', () async { 37 test('mixin', () async {
38 Uri mainUri = Uri.parse('memory:main.dart'); 38 Uri mainUri = Uri.parse('memory:main.dart');
39 await compiler.run(mainUri); 39 await compiler.run(mainUri);
40 LoadedLibraries libraries = 40 LoadedLibraries libraries =
41 await compiler.libraryLoader.loadLibrary(mainUri); 41 await compiler.libraryLoader.loadLibrary(mainUri);
42 compiler.processLoadedLibraries(libraries); 42 compiler.processLoadedLibraries(libraries);
43 JavaScriptBackend backend = compiler.backend; 43 JavaScriptBackend backend = compiler.backend;
44 ir.Program program = backend.kernelTask.buildProgram(libraries.rootLibrary); 44 ir.Program program = backend.kernelTask.buildProgram(libraries.rootLibrary);
45 ClosedWorldClassHierarchy hierarchy = 45 ClosedWorldClassHierarchy hierarchy =
(...skipping 26 matching lines...) Expand all
72 hierarchy.getDispatchTarget(subClass, member.name), equals(member), 72 hierarchy.getDispatchTarget(subClass, member.name), equals(member),
73 reason: 'Unexpected dispatch target for ${member.name} ' 73 reason: 'Unexpected dispatch target for ${member.name} '
74 'in $subClass'); 74 'in $subClass');
75 } 75 }
76 } 76 }
77 77
78 checkInheritance(classS, classC); 78 checkInheritance(classS, classC);
79 checkInheritance(classM, classC); 79 checkInheritance(classM, classC);
80 }); 80 });
81 } 81 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698