This repository was archived by the owner on Aug 17, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
design/proposals/module-linking Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -127,11 +127,11 @@ Notes:
127
127
* For instance-export aliases, ` i ` is validated to refer to an instance in the
128
128
instance index space that actually exports ` nm ` with the specified definition
129
129
kind.
130
- * For outer aliases, ` ct ` is validated to be * less than* the number of enclosing
131
- modules and ` i ` is validated to be a valid index in the specified
132
- definition's index space of the enclosing adapter module indicated by ` ct `
133
- (counting outward, starting with ` 0 ` referring to the immediately-enclosing
134
- adapter module).
130
+ * For outer aliases, ` ct ` is validated to be * less or equal than* the number
131
+ of enclosing modules and ` i ` is validated to be a valid index in the
132
+ specified definition's index space of the enclosing adapter module indicated
133
+ by ` ct ` (counting outward, starting with ` 0 ` referring to the current adapter
134
+ module).
135
135
136
136
137
137
## Type Definitions
Original file line number Diff line number Diff line change @@ -544,7 +544,10 @@ aliases `$Outer`'s `$Libc` module, avoiding the need to manually import it:
544
544
```
545
545
Here, ` $Outer ` and ` $Libc ` serve as symbolic [ de Bruijn indices] , ultimately
546
546
resolving to a pair of integers: the number of enclosing adapter modules to
547
- skip, and the index of the target definition.
547
+ skip, and the index of the target definition. In particular, this number can be
548
+ 0, in which case the outer alias refers to the current module, allowing a
549
+ single module to alias its own definitions at multiple indices in the index
550
+ space (which can be [ useful to tools] [ Issue-30 ] ).
548
551
549
552
Adapter module definitions containing outer aliases effectively produce a
550
553
module [ closure] at instantiation time, including a copy of the outer-aliased
@@ -908,3 +911,5 @@ import Foo from "./foo.wasm" as "wasm-module";
908
911
[ Figma plugins ] : https://www.figma.com/blog/an-update-on-plugin-security/
909
912
[ Attenuate ] : http://cap-lore.com/CapTheory/Patterns/Attenuation.html
910
913
[ Default Export ] : https://developer.mozilla.org/en-US/docs/web/javascript/reference/statements/export#Description
914
+
915
+ [ Issue-30 ] : https://github.com/WebAssembly/module-linking/issues/30
You can’t perform that action at this time.
0 commit comments