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

Unified Diff: dart/frog/leg/frog_leg.dart

Issue 9813012: Add "mock" compilation feature to dart2js and use it to improve test coverage. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: dart/frog/leg/frog_leg.dart
diff --git a/dart/frog/leg/frog_leg.dart b/dart/frog/leg/frog_leg.dart
index 100f2eb33f8d855978937ff58a07d3e46431acd9..6824041a59daa57867b1775ae95243d95e18a1ee 100644
--- a/dart/frog/leg/frog_leg.dart
+++ b/dart/frog/leg/frog_leg.dart
@@ -42,6 +42,7 @@ String relativize(Uri base, Uri uri) {
bool compile(frog.World world) {
final throwOnError = frog.options.throwOnErrors;
final showWarnings = frog.options.showWarnings;
+ final allowMockCompilation = frog.options.allowMockCompilation;
// final compiler = new WorldCompiler(world, throwOnError);
Uri cwd = new Uri(scheme: 'file', path: io.getCurrentDirectory());
Uri uri = cwd.resolve(frog.options.dartScript);
@@ -79,9 +80,12 @@ bool compile(frog.World world) {
if (fatal && throwOnError) throw new AbortLeg(message);
}
+ List<String> options = new List<String>();
+ if (allowMockCompilation) options.add('--allow-mock-compilation');
+
// TODO(ahe): We expect the future to be complete and call value
// directly. In effect, we don't support truly asynchronous API.
- String code = api.compile(uri, libraryRoot, provider, handler).value;
+ String code = api.compile(uri, libraryRoot, provider, handler, options).value;
if (code === null) return false;
world.legCode = code;
world.jsBytesWritten = code.length;

Powered by Google App Engine
This is Rietveld 408576698