| OLD | NEW |
| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 } | 122 } |
| 123 | 123 |
| 124 class Module : AbstractModule { | 124 class Module : AbstractModule { |
| 125 constructor (Application application, Document document, String url); // O(1) | 125 constructor (Application application, Document document, String url); // O(1) |
| 126 readonly attribute Application application; // O(1) | 126 readonly attribute Application application; // O(1) |
| 127 | 127 |
| 128 attribute any exports; // O(1) // defaults to {} | 128 attribute any exports; // O(1) // defaults to {} |
| 129 } | 129 } |
| 130 | 130 |
| 131 class Application : AbstractModule { | 131 class Application : AbstractModule { |
| 132 constructor (Document document, String url); // O(1) | 132 constructor (Document document, GestureManager gestureManager, String url); //
O(1) |
| 133 attribute String title; // O(1) | 133 attribute String title; // O(1) |
| 134 readonly attribute GestureManager gestureManager; |
| 134 } | 135 } |
| 135 ``` | 136 ``` |
| 136 | 137 |
| 137 | 138 |
| 138 Naming modules | 139 Naming modules |
| 139 -------------- | 140 -------------- |
| 140 | 141 |
| 141 The ``as`` attribute on the ``import`` element binds a name to the | 142 The ``as`` attribute on the ``import`` element binds a name to the |
| 142 imported module: | 143 imported module: |
| 143 | 144 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 156 Where ``name_1`` through ``name_n`` are the names bound to the | 157 Where ``name_1`` through ``name_n`` are the names bound to the |
| 157 various named imports in the script element's document, | 158 various named imports in the script element's document, |
| 158 ``source_code`` is the text content of the script element, | 159 ``source_code`` is the text content of the script element, |
| 159 ``source_module`` is the ``Module`` object of the script element's | 160 ``source_module`` is the ``Module`` object of the script element's |
| 160 module, and ``value_1`` through ``value_n`` are the values | 161 module, and ``value_1`` through ``value_n`` are the values |
| 161 exported by the various named imports in the script element's | 162 exported by the various named imports in the script element's |
| 162 document. | 163 document. |
| 163 | 164 |
| 164 When an import fails to load, the ``as`` name for the import gets | 165 When an import fails to load, the ``as`` name for the import gets |
| 165 bound to ``undefined``. | 166 bound to ``undefined``. |
| OLD | NEW |