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

Unified Diff: dart/frog/leg/emitter.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: 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/emitter.dart
diff --git a/dart/frog/leg/emitter.dart b/dart/frog/leg/emitter.dart
index 0a057355f354104fdb30d5954b8b02904817f3b3..034a5aba9fbfc84b48a582f3d0b51cbf23395419 100644
--- a/dart/frog/leg/emitter.dart
+++ b/dart/frog/leg/emitter.dart
@@ -653,9 +653,11 @@ function(child, parent) {
mainEnsureGetter = "$mainAccess.$invocationName = $mainAccess";
}
- // TODO(ngeoffray): These globals are currently required by the isolate
- // library, but since leg already generates code on an Isolate object, they
- // are not really needed. We should remove them once Leg replaces Frog.
+ if (compiler.isMockCompilation) return "";
+
+ // TODO(ngeoffray): These globals are currently required by the isolate
+ // library, but since leg already generates code on an Isolate object, they
+ // are not really needed. We should remove them once Leg replaces Frog.
return """
var \$globalThis = $currentIsolate;
var \$globalState;
@@ -692,7 +694,9 @@ ${namer.isolateAccess(isolateMain)}($mainAccess);""";
compiler.isolateLibrary.find(Compiler.START_ROOT_ISOLATE);
buffer.add(buildIsolateSetup(main, isolateMain));
} else {
- buffer.add('${namer.isolateAccess(main)}();\n');
+ if (!compiler.isMockCompilation) {
ngeoffray 2012/03/22 07:54:03 I would remove this check and the one line 656, to
ahe 2012/03/22 09:59:39 Done.
+ buffer.add('${namer.isolateAccess(main)}();\n');
+ }
}
compiler.assembledCode = buffer.toString();
});

Powered by Google App Engine
This is Rietveld 408576698