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

Unified Diff: lib/src/compiler/module_builder.dart

Issue 2006353002: Name loader functions. (Closed) Base URL: https://github.com/dart-lang/dev_compiler@master
Patch Set: Created 4 years, 7 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 | « lib/runtime/dart_sdk.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/compiler/module_builder.dart
diff --git a/lib/src/compiler/module_builder.dart b/lib/src/compiler/module_builder.dart
index 387f47a6539a30b7b1d439943bfddf3ff3f9b8dd..f87d0d3994ffba4c9c41016f57b7296a213b79ac 100644
--- a/lib/src/compiler/module_builder.dart
+++ b/lib/src/compiler/module_builder.dart
@@ -89,6 +89,10 @@ class LegacyModuleBuilder extends _ModuleBuilder {
var resultModule =
js.call("function(#) { 'use strict'; #; }", [parameters, statements]);
+ var functionName =
+ 'load__' + pathToJSIdentifier(module.name.replaceAll('.', '_'));
+ resultModule =
+ new NamedFunction(new Identifier(functionName), resultModule);
var moduleDef = js.statement("dart_library.library(#, #, #, #)", [
js.string(module.name, "'"),
« no previous file with comments | « lib/runtime/dart_sdk.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698