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

Side by Side Diff: sky/specs/modules.md

Issue 912873002: Specs: forgot to include this line in my last commit (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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 Sky Module System 1 Sky Module System
2 ================= 2 =================
3 3
4 This document describes the Sky module system. 4 This document describes the Sky module system.
5 5
6 Overview 6 Overview
7 -------- 7 --------
8 8
9 The Sky module system is based on the ``import`` element. In its 9 The Sky module system is based on the ``import`` element. In its
10 most basic form, you import a module as follows: 10 most basic form, you import a module as follows:
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 appended (but without affecting the library's list of declarations and 59 appended (but without affecting the library's list of declarations and
60 without any possibility of it clashing with identifiers described in 60 without any possibility of it clashing with identifiers described in
61 the library itself): 61 the library itself):
62 62
63 ```dart 63 ```dart
64 class _ { } 64 class _ { }
65 void main() { 65 void main() {
66 LibraryMirror library = reflectClass(_).owner as LibraryMirror; 66 LibraryMirror library = reflectClass(_).owner as LibraryMirror;
67 if (library.declarations.containsKey(#init) && library.declarations[#init] is MethodMirror) 67 if (library.declarations.containsKey(#init) && library.declarations[#init] is MethodMirror)
68 init(); 68 init();
69 module.init(library); 69 AutomaticMetadata.runLibrary(library, module);
70 } 70 }
71 ``` 71 ```
72 72
73 Then, that ``main()`` function is called. 73 Then, that ``main()`` function is called.
74 74
75 TODO(ianh): decide what URL and name we should give the libraries, as 75 TODO(ianh): decide what URL and name we should give the libraries, as
76 exposed in MirrorSystem.getName(libraryMirror.qualifiedName) etc 76 exposed in MirrorSystem.getName(libraryMirror.qualifiedName) etc
77 77
78 The ``Module`` class is defined in ``sky:core`` as follows: 78 The ``Module`` class is defined in ``sky:core`` as follows:
79 79
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 Where ``name_1`` through ``name_n`` are the names bound to the 141 Where ``name_1`` through ``name_n`` are the names bound to the
142 various named imports in the script element's document, 142 various named imports in the script element's document,
143 ``source_code`` is the text content of the script element, 143 ``source_code`` is the text content of the script element,
144 ``source_module`` is the ``Module`` object of the script element's 144 ``source_module`` is the ``Module`` object of the script element's
145 module, and ``value_1`` through ``value_n`` are the values 145 module, and ``value_1`` through ``value_n`` are the values
146 exported by the various named imports in the script element's 146 exported by the various named imports in the script element's
147 document. 147 document.
148 148
149 When an import fails to load, the ``as`` name for the import gets 149 When an import fails to load, the ``as`` name for the import gets
150 bound to ``undefined``. 150 bound to ``undefined``.
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698