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

Unified Diff: sky/specs/modules.md

Issue 946513006: Specs: pass the current <script> to the module library init() (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 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 | « sky/specs/frameworks.md ('k') | sky/specs/script.md » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/specs/modules.md
diff --git a/sky/specs/modules.md b/sky/specs/modules.md
index 25f8e62d034087914c01162410b9961d84d02566..475ef9461a623b7debf98205e7515c8861c52882 100644
--- a/sky/specs/modules.md
+++ b/sky/specs/modules.md
@@ -71,15 +71,17 @@ the library itself):
```dart
class _ { }
-void main() {
+void main(ScriptElement script) {
LibraryMirror library = reflectClass(_).owner as LibraryMirror;
- if (library.declarations.containsKey(#init) && library.declarations[#init] is MethodMirror)
- init();
- AutomaticMetadata.runLibrary(library, module);
+ if (library.declarations.containsKey(#_init) && library.declarations[#_init] is MethodMirror)
+ _init(script);
+ AutomaticMetadata.runLibrary(library, module, script);
}
```
-Then, that ``main()`` function is called.
+Then, that ``main(script)`` function is called, with ``script`` set to
+the ``ScriptElement`` object representing the relevant ``<script>``
+element.
TODO(ianh): decide what URL and name we should give the libraries, as
exposed in MirrorSystem.getName(libraryMirror.qualifiedName) etc
« no previous file with comments | « sky/specs/frameworks.md ('k') | sky/specs/script.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698