From 1dc44d30feab35d5a482e72c182aa45b7b517ed3 Mon Sep 17 00:00:00 2001 From: Luke Wagner Date: Fri, 14 Oct 2016 10:52:13 -0500 Subject: Tighten global import requirements (#816) --- JS.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'JS.md') diff --git a/JS.md b/JS.md index 4e5d84c..232377a 100644 --- a/JS.md +++ b/JS.md @@ -183,10 +183,11 @@ Let `imports` be an initially-empty [`import list`](https://github.com/WebAssemb For each [`import`](https://github.com/WebAssembly/spec/blob/master/ml-proto/spec/kernel.ml#L135) `i` in `module.imports` (assuming the ML spec `import` has been extended to have function, global, memory and table imports): -* Let `v` be the resultant value of performing - [`Get`](http://tc39.github.io/ecma262/#sec-get-o-p)(`importObject`, [`i.module_name`](https://github.com/WebAssembly/spec/blob/master/ml-proto/spec/kernel.ml#L139)). -* If `Type(v)` is not Object, throw a [`TypeError`](https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror). -* Let `v` be the value of performing [`Get`](http://tc39.github.io/ecma262/#sec-get-o-p)(`v`, `i.export_name`) +* Let `mv` be the resultant value of performing + [`Get`](http://tc39.github.io/ecma262/#sec-get-o-p)(`importObject`, [`i.module_name`](https://github.com/WebAssembly/spec/blob/master/ml-proto/spec/ast.ml#L170)). +* If `Type(mv)` is not Object, throw a [`TypeError`](https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror). +* Let `v` be the value of performing + [`Get`](http://tc39.github.io/ecma262/#sec-get-o-p)(`mv`, [`i.item_name`](https://github.com/WebAssembly/spec/blob/master/ml-proto/spec/ast.ml#L171)) * If `i` is a function import: * If [`IsCallable(v)`](https://tc39.github.io/ecma262/#sec-iscallable) is `false`, throw a [`TypeError`](https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror). @@ -205,6 +206,7 @@ function, global, memory and table imports): via [`ToWebAssemblyValue`](#towebassemblyvalue). * If `i` is a global import: * If `i` is not an immutable global, throw a [`TypeError`](https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror). + * If `Type(v)` is not Number, throw a [`TypeError`](https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror). * Append [`ToWebAssemblyValue`](#towebassemblyvalue)`(v)` to `imports`. * If `i` is a memory import: * If `v` is not a [`WebAssembly.Memory` object](#webassemblymemory-objects), -- cgit v1.2.3