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

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

Issue 689763002: Specs: Pass the module last so that if we add other values later we don't shift things in the argum… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 imported module: 54 imported module:
55 55
56 ```html 56 ```html
57 <import src="path/to/chocolate.sky" as="chocolate" /> 57 <import src="path/to/chocolate.sky" as="chocolate" />
58 ``` 58 ```
59 59
60 The parser executes the contents of script elements inside a module as 60 The parser executes the contents of script elements inside a module as
61 if they were executed as follow: 61 if they were executed as follow:
62 62
63 ```javascript 63 ```javascript
64 (new Function(module, name_1, ..., name_n, source_code)).call( 64 (new Function(name_1, ..., name_n, module, source_code)).call(
65 source_module, value_1, ..., value_n); 65 value_1, ..., value_n, source_module);
66 ``` 66 ```
67 67
68 Where ```name_1``` through ```name_n``` are the names bound to the 68 Where ```name_1``` through ```name_n``` are the names bound to the
69 various named imports in the script element's document, 69 various named imports in the script element's document,
70 ```source_code``` is the text content of the script element, 70 ```source_code``` is the text content of the script element,
71 ```source_module`` is the ```Module``` object of the script element's 71 ```source_module`` is the ```Module``` object of the script element's
72 module, and ```value_1``` through ```value_n``` are the values 72 module, and ```value_1``` through ```value_n``` are the values
73 exported by the various named imports in the script element's 73 exported by the various named imports in the script element's
74 document. 74 document.
75 75
76 When an import fails to load, the ```as``` name for the import gets 76 When an import fails to load, the ```as``` name for the import gets
77 bound to ```undefined```. 77 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