Skip to content

Commit dc5d368

Browse files
committed
Feedback from PR #97
* corrections on intrinsic object definitions * CreateRegistry() abstract operation is the only way to create registry objects.
1 parent 96b48c6 commit dc5d368

File tree

1 file changed

+38
-34
lines changed

1 file changed

+38
-34
lines changed

index.bs

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -161,34 +161,19 @@ We follow the ECMA-262 <a href="http://www.ecma-international.org/ecma-262/6.0/i
161161

162162
<h2 id="loader-objects">Loader Objects</h2>
163163

164-
<h3 id="loader-abstract-operations">Abstract Operations for Loader Objects</h3>
165-
166-
<h4 id="loader-CreateRegistry" aoid="CreateRegistry">CreateRegistry()</h4>
167-
168-
The abstract operation CreateRegistry with no arguments performs the following steps:
169-
170-
<emu-alg>
171-
1. Let _O_ be ? OrdinaryCreateFromConstructor(Registry, "%RegistryPrototype%", «[[RegistryMap]]» ).
172-
1. Return _O_.
173-
</emu-alg>
174-
175-
<emu-note>
176-
This abstract operation helps to prevent creation of new registry objects in user-land.
177-
</emu-note>
178-
179164
<h3 id="loader-constructor">The Loader Constructor</h3>
180165

181-
The Loader constructor is the initial value of the Loader property of the the Reflect object. When called as a constructor it creates and initializes a new Loader object. Loader is not intended to be called as a function and will throw an exception when called in that manner.
166+
The Loader constructor is the %Loader% intrinsic object and the initial value of the <b>Loader</b> property of the the Reflect object. When called as a constructor it creates and initializes a new Loader object. When <b>Loader</b> is called as a function rather than as a constructor, it throws an exception.
182167

183-
The Loader constructor is designed to be subclassable. It may be used as the value in an extends clause of a class definition. Subclass constructors that intend to inherit the specified Loader behaviour must include a super call to the Loader constructor to create and initialize the subclass instance with the internal stage necessary to support the Loader.prototype built-in methods.
168+
The <b>Loader</b> constructor is designed to be subclassable. It may be used as the value of an <b>extends</b> clause of a class definition. Subclass constructors that intend to inherit the specified <b>Loader</b> behaviour must include a <b>super</b> call to the <b>Loader</b> constructor to create and initialize the subclass instance with the corresponding internal slots.
184169

185170
<h4 id="new-loader">Loader()</h4>
186171

187172
When Loader is called with no arguments, the following steps are taken:
188173

189174
<emu-alg>
190175
1. If NewTarget is *undefined*, then throw a *TypeError* exception.
191-
1. Let _O_ be ? OrdinaryCreateFromConstructor(NewTarget, "Loader.prototype").
176+
1. Let _O_ be ? OrdinaryCreateFromConstructor(NewTarget, "%LoaderPrototype%").
192177
1. Set _O_’s [[Registry]] internal slot to CreateRegistry().
193178
1. Return _O_.
194179
</emu-alg>
@@ -199,17 +184,17 @@ The value of the \[[Prototype]] internal slot of the Loader constructor is the i
199184

200185
Besides the internal slots and the length property (whose value is 0), the Loader constructor has the following properties:
201186

202-
<h4 id="Loader.prototype">Loader.prototype</h4>
187+
<h4 id="loader-prototype">Loader.prototype</h4>
203188

204-
The value of Loader.prototype is an ordinary object.
189+
The value of Loader.prototype is %LoaderPrototype%.
205190

206191
This property has the attributes { \[[Writable]]: false, \[[Enumerable]]: false, \[[Configurable]]: false }.
207192

208193
<h3 id="sec-properties-of-the-loader-prototype-object">Properties of the Loader Prototype Object</h3>
209194

210195
<h4 id="Loader.prototype.constructor">Loader.prototype.constructor</h4>
211196

212-
The initial value of Loader.prototype.constructor is Loader.
197+
The initial value of Loader.prototype.constructor is the intrinsic object %Loader%.
213198

214199
<h4 id="loader-import">Loader.prototype.import(name[, referrer])</h4>
215200

@@ -297,22 +282,23 @@ Loader instances are initially created with the internal slots described in the
297282

298283
<h2 id="registry">Registry Objects</h2>
299284

300-
<h3 id="registry-constructor">The Registry Constructor</h3>
301-
302-
The Registry constructor is the %Registry% intrinsic object. When called as a constructor it creates and initializes a new %Registry% object. %Registry% is not intended to be called as a function and will throw an exception when called in that manner.
285+
<h3 id="registry-abstract-operations">Abstract Operations for Registry Objects</h3>
303286

304-
<h4 id="new-registry" aoid="Registry">Registry()</h4>
287+
<h4 id="registry-CreateRegistry" aoid="CreateRegistry">CreateRegistry()</h4>
305288

306-
When Registry is called with no arguments, the following steps are taken:
289+
The abstract operation CreateRegistry with no arguments performs the following steps:
307290

308291
<emu-alg>
309-
1. If NewTarget is *undefined*, then throw a *TypeError* exception.
310-
1. Let _O_ be ? OrdinaryCreateFromConstructor(NewTarget, "%RegistryPrototype%", «[[RegistryMap]]» ).
292+
1. Let _O_ be ? OrdinaryCreateFromConstructor(Registry, "%RegistryPrototype%", «[[RegistryMap]]» ).
311293
1. Let _M_ be ObjectCreate(%MapIteratorPrototype%, «[[Map]], [[MapNextIndex]], [[MapIterationKind]]»).
312294
1. Set _O_’s [[RegistryMap]] internal slot to _M_.
313295
1. Return _O_.
314296
</emu-alg>
315297

298+
<h3 id="registry-constructor">The Registry Constructor</h3>
299+
300+
The Registry constructor is the %Registry% intrinsic object. When called as a constructor it creates and initializes a new Registry object. When <b>Registry</b> is called as a function rather than as a constructor, it throws an exception.
301+
316302
<h3 id="properties-of-the-registry-constructor">Properties of the Registry Constructor</h3>
317303

318304
The value of the \[[Prototype]] internal slot of the Registry constructor is the intrinsic object %FunctionPrototype%.
@@ -614,7 +600,9 @@ Each \[[Stage]] value indicates the currently pending operation. If the \[[Resul
614600

615601
<h3 id="module-status-constructor">The ModuleStatus Constructor</h3>
616602

617-
The ModuleStatus constructor is the initial value of the Status property of the the Reflect.Module object. When called as a constructor it creates and initializes a new ModuleStatus object. ModuleStatus is not intended to be called as a function and will throw an exception when called in that manner.
603+
The ModuleStatus constructor is the %ModuleStatus% intrinsic object and the initial value of the <b>Status</b> property of the Reflect.Module object. When called as a constructor it creates and initializes a new ModuleStatus object. When <b>ModuleStatus</b> is called as a function rather than as a constructor, it throws an exception.
604+
605+
The <b>ModuleStatus</b> constructor is designed to be subclassable. It may be used as the value of an <b>extends</b> clause of a class definition. Subclass constructors that intend to inherit the specified <b>ModuleStatus</b> behaviour must include a <b>super</b> call to the <b>ModuleStatus</b> constructor to create and initialize the subclass instance with the corresponding internal slots.
618606

619607
<h4 id="new-module-status" aoid="ModuleStatus">ModuleStatus(loader, key[, module])</h4>
620608

@@ -677,7 +665,7 @@ This property has the attributes { \[[Writable]]: false, \[[Enumerable]]: false,
677665

678666
<h4 id="module-status-prototype-constructor">ModuleStatus.prototype.constructor</h4>
679667

680-
The initial value of ModuleStatus.prototype.constructor is %Registry%.
668+
The initial value of ModuleStatus.prototype.constructor is the intrinsic object %ModuleStatus%.
681669

682670
<h4 id="module-status-stage">get ModuleStatus.prototype.stage</h4>
683671

@@ -1311,7 +1299,7 @@ The Default Browser Loader Object is an %BrowserLoader% instance, whose internal
13111299

13121300
<h3 id="browser-loader-constructor">The BrowserLoader Constructor</h3>
13131301

1314-
The BrowserLoader constructor is the %BrowserLoader% intrinsic object. When called as a constructor it creates and initializes a new %BrowserLoader% object. %BrowserLoader% is not intended to be called as a function and will throw an exception when called in that manner.
1302+
The BrowserLoader constructor is the %BrowserLoader% intrinsic object. When called as a constructor it creates and initializes a new BrowserLoader object. When <b>BrowserLoader</b> is called as a function rather than as a constructor, it throws an exception.
13151303

13161304
<h3 id="properties-of-the-browser-loader-constructor">Properties of the BrowserLoader Constructor</h3>
13171305

@@ -1388,20 +1376,36 @@ The intrinsics are listed in table below:
13881376
<th>Description (<em>non-normative</em>)</th>
13891377
</tr>
13901378
</thead>
1379+
<tr>
1380+
<td>%Loader%</td>
1381+
<td>The loader constructor (<a href="#loader-constructor">3.1</a>)</td>
1382+
</tr>
1383+
<tr>
1384+
<td>%LoaderPrototype%</td>
1385+
<td>The initial value of the *prototype* data property of %Loader% (<a href="#loader-prototype">3.2.1</a>)</td>
1386+
</tr>
13911387
<tr>
13921388
<td>%BrowserLoader%</td>
1393-
<td>The browser loader constructor (<a href="#browser-loader-constructor">10.1</a>)</td>
1389+
<td>The browser loader constructor (<a href="#browser-loader-constructor">11.1</a>)</td>
13941390
</tr>
13951391
<tr>
13961392
<td>%BrowserLoaderPrototype%</td>
1397-
<td>The initial value of the *prototype* data property of %BrowserLoader% (<a href="#browser-loader-prototype">10.2.1</a>)</td>
1393+
<td>The initial value of the *prototype* data property of %BrowserLoader% (<a href="#browser-loader-prototype">11.2.1</a>)</td>
13981394
</tr>
13991395
<tr>
14001396
<td>%Registry%</td>
1401-
<td>The registry constructor (<a href="#registry-constructor">4.1</a>)</td>
1397+
<td>The registry constructor (<a href="#registry-constructor">4.2</a>)</td>
14021398
</tr>
14031399
<tr>
14041400
<td>%RegistryPrototype%</td>
14051401
<td>The initial value of the *prototype* data property of %Registry% (<a href="#registry-prototype">4.3.1</a>)</td>
14061402
</tr>
1403+
<tr>
1404+
<td>%ModuleStatus%</td>
1405+
<td>The module status constructor (<a href="#module-status-constructor">5.2</a>)</td>
1406+
</tr>
1407+
<tr>
1408+
<td>%ModuleStatusPrototype%</td>
1409+
<td>The initial value of the *prototype* data property of %ModuleStatus% (<a href="#module-status-prototype">5.3.1</a>)</td>
1410+
</tr>
14071411
</table>

0 commit comments

Comments
 (0)