Skip to content

Commit 9508470

Browse files
committed
cleaning the dynamic module record implementation, feedback from @dherman on PR #65
1 parent 8bcc644 commit 9508470

File tree

1 file changed

+33
-37
lines changed

1 file changed

+33
-37
lines changed

index.bs

Lines changed: 33 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,36 @@ The modules spec should only invoke this operation from methods of Source Text M
808808

809809
<h2 id="module-objects">Module Objects</h2>
810810

811-
<h3 id="registry-abstract-operations">Abstract Operations for Module Objects</h3>
811+
<h3 id="reflective-module-record">Reflective Module Records</h3>
812+
813+
A <dfn>reflective module record</dfn> is a kind of module record. It extends
814+
815+
<table>
816+
<thead>
817+
<tr>
818+
<th>Internal Slot</th>
819+
<th>Value Type (<em>non-normative</em>)</th>
820+
<th>Description (<em>non-normative</em>)</th>
821+
</tr>
822+
</thead>
823+
<tr>
824+
<td>\[[LocalExports]]</td>
825+
<td>A List of Strings</td>
826+
<td>The set of exported names stored in this module's environment.</td>
827+
</tr>
828+
<tr>
829+
<td>\[[IndirectExports]]</td>
830+
<td>A List of pairs of String and {\[[module]]: Module Record, \[[bindingName]]: String}.</td>
831+
<td>The set of re-exported bindings. This ensures that ResolveExport can fully resolve re-exports.</td>
832+
</tr>
833+
<tr>
834+
<td>\[[Evaluate]]</td>
835+
<td>A function object or <code>undefined</code></td>
836+
<td>A thunk to call when the the module is evaluated, or <code>undefined</code> if the module is already evaluated.</td>
837+
</tr>
838+
</table>
839+
840+
-<h3 id="module-abstract-operations">Abstract Operations for Module Objects</h3>
812841

813842
<h4 id="parse-exports-descriptors" aoid="ParseExportsDescriptors">ParseExportsDescriptors(obj)</h4>
814843

@@ -885,7 +914,7 @@ Reflective modules are always already instantiated.
885914

886915
The Module constructor is the initial value of the Module property of the the Reflect object. When called as a constructor it creates and initializes a new Module object. Reflect.Module is not intended to be called as a function and will throw an exception when called in that manner.
887916

888-
The Reflect.Module 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 Module behaviour must include a super call to the Reflect.Module constructor to create and initialize the subclass instance with the internal state necessary to support the Reflect.Module.prototype built-in methods.
917+
The Reflect.Module 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 Module behaviour must include a super call to the Reflect.Module constructor to create and initialize the subclass instance with the internal state necessary to integrated with loaders.
889918

890919
<h4 id="new-reflect-module">Reflect.Module(descriptors[, executor[, evaluate]])</h4>
891920

@@ -942,46 +971,13 @@ Besides the internal slots and the length property (whose value is 0), the Refle
942971

943972
<h4 id="Reflect.Module.prototype">Reflect.Module.prototype</h4>
944973

945-
The value of Reflect.Module.prototype is an ordinary object with a null [[Prototype]].
974+
The value of Reflect.Module.prototype is an ordinary object with a null \[[Prototype]].
946975

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

949-
<h3 id="module-prototype-object">Properties of the Reflect.Module Prototype Object</h3>
950-
951-
<h4 id="Reflect.Module.prototype.constructor">Reflect.Module.prototype.constructor</h4>
952-
953-
The initial value of Reflect.Module.prototype.constructor is Reflect.Module.
954-
955978
<h3 id="reflect-module-internal-slots">Properties of Module Instances</h3>
956979

957-
Reflect.Module instances are ordinary objects that inherit properties from the Reflect.Module.prototype.
958-
959-
Reflect.Module instances are initially created with the internal slots described in the following table:
960-
961-
<table>
962-
<thead>
963-
<tr>
964-
<th>Internal Slot</th>
965-
<th>Value Type (<em>non-normative</em>)</th>
966-
<th>Description (<em>non-normative</em>)</th>
967-
</tr>
968-
</thead>
969-
<tr>
970-
<td>\[[LocalExports]]</td>
971-
<td>A List of Strings</td>
972-
<td>The set of exported names stored in this module's environment.</td>
973-
</tr>
974-
<tr>
975-
<td>\[[IndirectExports]]</td>
976-
<td>A List of pairs of String and {\[[module]]: Module Record, \[[bindingName]]: String}.</td>
977-
<td>The set of re-exported bindings. This ensures that ResolveExport can fully resolve re-exports.</td>
978-
</tr>
979-
<tr>
980-
<td>\[[Evaluate]]</td>
981-
<td>A function object or <code>undefined</code></td>
982-
<td>A thunk to call when the the module is evaluated, or <code>undefined</code> if the module is already evaluated.</td>
983-
</tr>
984-
</table>
980+
Reflect.Module instances are module namespace exotic objects.
985981

986982
<h2 id="local">Local Loading</h2>
987983

0 commit comments

Comments
 (0)