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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart

Issue 169283007: Revert "Allow to intercept arguments to main with dartMainRunner." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/js_emitter/declarations.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart b/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart
index 4f975e2ad6fe748395d9afbb3fe0b24cbc3b2f75..531d1e6693d1b8975d76342144ecc9707df3894b 100644
--- a/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart
@@ -963,15 +963,13 @@ class CodeEmitterTask extends CompilerTask {
''');
}
- /// Returns the code equivalent to:
- /// `function(args) { $.startRootIsolate(X.main$closure(), args); }`
- String buildIsolateSetupClosure(CodeBuffer buffer,
- Element appMain,
- Element isolateMain) {
+ String buildIsolateSetup(CodeBuffer buffer,
+ Element appMain,
+ Element isolateMain) {
String mainAccess = "${namer.isolateStaticClosureAccess(appMain)}";
// Since we pass the closurized version of the main method to
// the isolate method, we must make sure that it exists.
- return "(function(a){${namer.isolateAccess(isolateMain)}($mainAccess,a)})";
+ return "${namer.isolateAccess(isolateMain)}($mainAccess)";
}
/**
@@ -1024,13 +1022,13 @@ class CodeEmitterTask extends CompilerTask {
emitMain(CodeBuffer buffer) {
if (compiler.isMockCompilation) return;
Element main = compiler.mainFunction;
- String mainCallClosure = null;
+ String mainCall = null;
if (compiler.hasIsolateSupport()) {
Element isolateMain =
compiler.isolateHelperLibrary.find(Compiler.START_ROOT_ISOLATE);
- mainCallClosure = buildIsolateSetupClosure(buffer, main, isolateMain);
+ mainCall = buildIsolateSetup(buffer, main, isolateMain);
} else {
- mainCallClosure = '${namer.isolateAccess(main)}';
+ mainCall = '${namer.isolateAccess(main)}()';
}
if (backend.needToInitializeIsolateAffinityTag) {
@@ -1077,9 +1075,9 @@ class CodeEmitterTask extends CompilerTask {
init.currentScript = currentScript;
if (typeof dartMainRunner === "function") {
- dartMainRunner(${mainCallClosure}, []);
+ dartMainRunner(function() { ${mainCall}; });
} else {
- ${mainCallClosure}([]);
+ ${mainCall};
}
})$N''');
addComment('END invoke [main].', buffer);
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/js_emitter/declarations.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698