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

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

Issue 2989453002: Add support for compiling Dart via the FE in dart2js. (Closed)
Patch Set: update status Created 3 years, 5 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 IR as 5 /// Test that the dart2js copy of [KernelVisitor] generates the expected IR as
6 /// defined by kernel spec-mode test files. 6 /// defined by kernel spec-mode test files.
7 7
8 import 'dart:io'; 8 import 'dart:io';
9 import 'dart:async'; 9 import 'dart:async';
10 import 'package:compiler/src/compiler.dart' show Compiler; 10 import 'package:compiler/src/compiler.dart' show Compiler;
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 print(expected); 90 print(expected);
91 print('--actual----------------------------------------------------'); 91 print('--actual----------------------------------------------------');
92 print(actual); 92 print(actual);
93 } 93 }
94 expect(actual, equals(expected)); 94 expect(actual, equals(expected));
95 }); 95 });
96 } 96 }
97 97
98 Future<Compiler> newCompiler() async { 98 Future<Compiler> newCompiler() async {
99 var compiler = compilerFor( 99 var compiler = compilerFor(
100 options: [Flags.analyzeOnly, Flags.analyzeAll, Flags.useKernel]); 100 options: [Flags.analyzeOnly, Flags.analyzeAll, Flags.useKernelInSsa]);
101 await compiler.setupSdk(); 101 await compiler.setupSdk();
102 102
103 // The visitor no longer enqueues elements that are not reachable from the 103 // The visitor no longer enqueues elements that are not reachable from the
104 // program. The mixin-full resolution transform run by the test expects to 104 // program. The mixin-full resolution transform run by the test expects to
105 // find dart.core::Iterator. 105 // find dart.core::Iterator.
106 var loadedLibraries = 106 var loadedLibraries =
107 await compiler.libraryLoader.loadLibrary(Uri.parse('dart:core')); 107 await compiler.libraryLoader.loadLibrary(Uri.parse('dart:core'));
108 compiler.processLoadedLibraries(loadedLibraries); 108 compiler.processLoadedLibraries(loadedLibraries);
109 dynamic core = loadedLibraries.rootLibrary; 109 dynamic core = loadedLibraries.rootLibrary;
110 compiler.startResolution(); 110 compiler.startResolution();
111 var cls = core.implementation.localLookup('Iterator'); 111 var cls = core.implementation.localLookup('Iterator');
112 cls.ensureResolved(compiler.resolution); 112 cls.ensureResolved(compiler.resolution);
113 return compiler; 113 return compiler;
114 } 114 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698