Skip to content

Commit c0312a8

Browse files
committed
[js-api][web-api] Editorial: Fix some minor issues.
Fixes #1064.
1 parent 82a613d commit c0312a8

File tree

2 files changed

+26
-30
lines changed

2 files changed

+26
-30
lines changed

document/js-api/index.bs

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ urlPrefix: https://tc39.github.io/ecma262/; spec: ECMASCRIPT
3434
text: TypeError; url: sec-native-error-types-used-in-this-standard-typeerror
3535
text: RangeError; url: sec-native-error-types-used-in-this-standard-rangeerror
3636
type: dfn
37+
url: sec-returnifabrupt-shorthands
38+
text: !
39+
text: ?
3740
text: agent cluster; url: sec-agent-clusters
3841
text: agent; url: agent
3942
text: data block; url: sec-data-blocks
@@ -355,9 +358,9 @@ A {{Module}} object represents a single WebAssembly module. Each {{Module}} obje
355358
1. If |module|.[=imports=] [=list/is empty|is not empty=], and |importObject| is undefined, throw a {{TypeError}} exception.
356359
1. Let |imports| be « ».
357360
1. [=list/iterate|For each=] (|moduleName|, |componentName|, |externtype|) of [=module_imports=](|module|),
358-
1. Let |o| be ? [=Get=](|importObject|, |moduleName|).
361+
1. Let |o| be [=?=] [=Get=](|importObject|, |moduleName|).
359362
1. If [=Type=](|o|) is not Object, throw a {{TypeError}} exception.
360-
1. Let |v| be ? [=Get=](|o|, |componentName|).
363+
1. Let |v| be [=?=] [=Get=](|o|, |componentName|).
361364
1. If |externtype| is of the form [=func=] |functype|,
362365
1. If [=IsCallable=](|v|) is false, throw a {{LinkError}} exception.
363366
1. If |v| has a \[[FunctionAddress]] internal slot, and therefore is an [=Exported Function=],
@@ -403,7 +406,7 @@ The verification of WebAssembly type requirements is deferred to the
403406

404407
<div algorithm>
405408
To <dfn>create an exports object</dfn> from a WebAssembly module |module| and instance |instance|, perform the following steps:
406-
1. Let |exportsObject| be ! [=ObjectCreate=](null).
409+
1. Let |exportsObject| be [=!=] [=ObjectCreate=](null).
407410
1. [=list/iterate|For each=] (|name|, |externtype|) of [=module_exports=](|module|),
408411
1. Let |externval| be [=instance_export=](|instance|, |name|).
409412
1. Assert: |externval| is not [=error=].
@@ -427,11 +430,11 @@ The verification of WebAssembly type requirements is deferred to the
427430
1. Let [=external value|table=] |tableaddr| be |externval|.
428431
1. Let |table| be [=create a Table object|a new Table object=] created from |tableaddr|.
429432
1. Let |value| be |table|.
430-
1. Let |status| be ! [=CreateDataProperty=](|exportsObject|, |name|, |value|).
433+
1. Let |status| be [=!=] [=CreateDataProperty=](|exportsObject|, |name|, |value|).
431434
1. Assert: |status| is true.
432435

433436
Note: the validity and uniqueness checks performed during [=WebAssembly module validation=] ensure that each property name is valid and no properties are defined twice.
434-
1. Perform ! [=SetIntegrityLevel=](|exportsObject|, `"frozen"`).
437+
1. Perform [=!=] [=SetIntegrityLevel=](|exportsObject|, `"frozen"`).
435438
1. Return |exportsObject|.
436439
</div>
437440

@@ -687,7 +690,7 @@ which can be simultaneously referenced by multiple {{Instance}} objects. Each
687690
1. Let |map| be the [=surrounding agent=]'s associated [=Memory object cache=].
688691
1. Assert: |map|[|memaddr|] [=map/exists=].
689692
1. Let |memory| be |map|[|memaddr|].
690-
1. Perform ! [=DetachArrayBuffer=](|memory|.\[[BufferObject]], "WebAssembly.Memory").
693+
1. Perform [=!=] [=DetachArrayBuffer=](|memory|.\[[BufferObject]], "WebAssembly.Memory").
691694
1. Let |buffer| be the result of [=create a memory buffer|creating a memory buffer=] from |memaddr|.
692695
1. Set |memory|.\[[BufferObject]] to |buffer|.
693696
</div>
@@ -777,7 +780,7 @@ Each {{Table}} object has a \[[Table]] internal slot, which is a [=table address
777780
1. If |value| is missing,
778781
1. Let |ref| be [=DefaultValue=](|elementType|).
779782
1. Otherwise,
780-
1. Let |ref| be ? [=ToWebAssemblyValue=](|value|, |elementType|).
783+
1. Let |ref| be [=?=] [=ToWebAssemblyValue=](|value|, |elementType|).
781784
1. Let |type| be the [=table type=] {[=table type|min=] |initial|, [=table type|max=] |maximum|} |elementType|.
782785
1. Let |store| be the [=surrounding agent=]'s [=associated store=].
783786
1. Let (|store|, |tableaddr|) be [=table_alloc=](|store|, |type|, |ref|). <!-- TODO(littledan): Report allocation failure https://github.com/WebAssembly/spec/issues/584 -->
@@ -794,7 +797,7 @@ Each {{Table}} object has a \[[Table]] internal slot, which is a [=table address
794797
1. If |value| is missing,
795798
1. Let |ref| be [=DefaultValue=](|elementType|).
796799
1. Otherwise,
797-
1. Let |ref| be ? [=ToWebAssemblyValue=](|value|, |elementType|).
800+
1. Let |ref| be [=?=] [=ToWebAssemblyValue=](|value|, |elementType|).
798801
1. Let |result| be [=table_grow=](|store|, |tableaddr|, |delta|, |ref|).
799802
1. If |result| is [=error=], throw a {{RangeError}} exception.
800803

@@ -827,7 +830,7 @@ Each {{Table}} object has a \[[Table]] internal slot, which is a [=table address
827830
1. If |value| is missing,
828831
1. Let |ref| be [=DefaultValue=](|elementType|).
829832
1. Otherwise,
830-
1. Let |ref| be ? [=ToWebAssemblyValue=](|value|, |elementType|).
833+
1. Let |ref| be [=?=] [=ToWebAssemblyValue=](|value|, |elementType|).
831834
1. Let |store| be the [=surrounding agent=]'s [=associated store=].
832835
1. Let |store| be [=table_write=](|store|, |tableaddr|, |index|, |ref|).
833836
1. If |store| is [=error=], throw a {{RangeError}} exception.
@@ -977,7 +980,7 @@ This slot holds a [=function address=] relative to the [=surrounding agent=]'s [
977980
1. Let |moduleinst| be |funcinst|.module.
978981
1. Assert: |funcaddr| is contained in |moduleinst|.funcaddrs.
979982
1. Let |index| be the index of |moduleinst|.funcaddrs where |funcaddr| is found.
980-
1. Return ! [=ToString=](|index|).
983+
1. Return [=!=] [=ToString=](|index|).
981984
</div>
982985

983986
<div algorithm>
@@ -1004,7 +1007,7 @@ This slot holds a [=function address=] relative to the [=surrounding agent=]'s [
10041007

10051008
1. Let |store| be the [=surrounding agent=]'s [=associated store=].
10061009
1. Let |functype| be [=func_type=](|store|, |funcaddr|).
1007-
1. Let [|parameters|][<var ignore>results</var>] be |functype|.
1010+
1. Let [|parameters|][|results|] be |functype|.
10081011
1. If |parameters| or |results| contain [=v128=], throw a {{TypeError}}.
10091012

10101013
Note: the above error is thrown each time the \[[Call]] method is invoked.
@@ -1035,19 +1038,19 @@ Note: Exported Functions do not have a \[[Construct]] method and thus it is not
10351038
<div algorithm>
10361039
To <dfn>run a host function</dfn> from the JavaScript object |func|, type |functype|, and [=list=] of [=WebAssembly values=] |arguments|, perform the following steps:
10371040

1038-
1. Let [<var ignore>parameters</var>][|results|] be |functype|.
1041+
1. Let [|parameters|][|results|] be |functype|.
10391042
1. If |parameters| or |results| contain [=v128=], throw a {{TypeError}}.
10401043
1. Let |jsArguments| be « ».
10411044
1. [=list/iterate|For each=] |arg| of |arguments|,
1042-
1. [=list/Append=] ! [=ToJSValue=](|arg|) to |jsArguments|.
1043-
1. Let |ret| be ? [=Call=](|func|, undefined, |jsArguments|).
1045+
1. [=list/Append=] [=!=] [=ToJSValue=](|arg|) to |jsArguments|.
1046+
1. Let |ret| be [=?=] [=Call=](|func|, undefined, |jsArguments|).
10441047
1. Let |resultsSize| be |results|'s [=list/size=].
10451048
1. If |resultsSize| is 0, return « ».
1046-
1. Otherwise, if |resultsSize| is 1, return « ? [=ToWebAssemblyValue=](|ret|, |results|[0]) ».
1049+
1. Otherwise, if |resultsSize| is 1, return « [=?=] [=ToWebAssemblyValue=](|ret|, |results|[0]) ».
10471050
1. Otherwise,
1048-
1. Let |method| be ? [=GetMethod=](|ret|, [=@@iterator=]).
1051+
1. Let |method| be [=?=] [=GetMethod=](|ret|, [=@@iterator=]).
10491052
1. If |method| is undefined, [=throw=] a {{TypeError}}.
1050-
1. Let |values| be ? [=IterableToList=](|ret|, |method|).
1053+
1. Let |values| be [=?=] [=IterableToList=](|ret|, |method|).
10511054
1. Let |wasmValues| be a new, empty [=list=].
10521055
1. If |values|'s [=list/size=] is not |resultsSize|, throw a {{TypeError}} exception.
10531056
1. For each |value| and |resultType| in |values| and |results|, paired linearly,
@@ -1109,16 +1112,16 @@ The algorithm <dfn>ToWebAssemblyValue</dfn>(|v|, |type|) coerces a JavaScript va
11091112

11101113
1. Assert: |type| is not [=v128=].
11111114
1. If |type| is [=i64=],
1112-
1. Let |i64| be ? [=ToBigInt64=](|v|).
1115+
1. Let |i64| be [=?=] [=ToBigInt64=](|v|).
11131116
1. Return [=i64.const=] |i64|.
11141117
1. If |type| is [=i32=],
1115-
1. Let |i32| be ? [=ToInt32=](|v|).
1118+
1. Let |i32| be [=?=] [=ToInt32=](|v|).
11161119
1. Return [=i32.const=] |i32|.
11171120
1. If |type| is [=f32=],
1118-
1. Let |f32| be ? [=ToNumber=](|v|) rounded to the nearest representable value using IEEE 754-2008 round to nearest, ties to even mode.
1121+
1. Let |f32| be [=?=] [=ToNumber=](|v|) rounded to the nearest representable value using IEEE 754-2008 round to nearest, ties to even mode.
11191122
1. Return [=f32.const=] |f32|.
11201123
1. If |type| is [=f64=],
1121-
1. Let |f64| be ? [=ToNumber=](|v|).
1124+
1. Let |f64| be [=?=] [=ToNumber=](|v|).
11221125
1. Return [=f64.const=] |f64|.
11231126
1. If |type| is [=funcref=],
11241127
1. If |v| is null,
@@ -1150,7 +1153,7 @@ When the [=namespace object=] for the {{WebAssembly}} namespace is [=create a na
11501153
1. Let |namespaceObject| be the [=namespace object=].
11511154
1. [=list/iterate|For each=] |error| of « "CompileError", "LinkError", "RuntimeError" »,
11521155
1. Let |constructor| be a new object, implementing the [=NativeError Object Structure=], with <var ignore>NativeError</var> set to |error|.
1153-
1. ! [$CreateMethodProperty$](|namespaceObject|, |error|, |constructor|).
1156+
1. [=!=] [$CreateMethodProperty$](|namespaceObject|, |error|, |constructor|).
11541157

11551158
</div>
11561159

document/web-api/index.bs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,6 @@ Prepare For TR: true
3232
"title": "WebAssembly JS Integration Specification",
3333
"publisher": "W3C WebAssembly Community Group",
3434
"status": "Draft"
35-
},
36-
"SECURECONTEXTS": {
37-
"href": "https://w3c.github.io/webappsec-secure-contexts/",
38-
"title": "Secure Contexts",
39-
"publisher": "WebAppSec WG",
40-
"status": "Candidate Recommendation"
4135
}
4236
}
4337
</pre>
@@ -71,7 +65,6 @@ urlPrefix: https://webassembly.github.io/spec/js-api/; spec: WASMJS
7165
text: Exported Function; url: #exported-function
7266
url:https://html.spec.whatwg.org/#cors-same-origin;text:CORS-same-origin;type:dfn;spec:HTML
7367
url:https://fetch.spec.whatwg.org/#concept-body-consume-body;text:consume body;type:dfn;spec:FETCH
74-
url:https://w3c.github.io/webappsec-secure-contexts/#environment-settings-object-contextually-secure; text:contextually secure; type: dfn; spec: SECURECONTEXTS
7568
</pre>
7669

7770
<pre class='link-defaults'>
@@ -151,7 +144,7 @@ The [=serialization steps=], given |value|, |serialized|, and |forStorage|, are:
151144

152145
1. Set |serialized|.\[[AgentCluster]] to the [=current Realm=]'s corresponding [=agent cluster=].
153146

154-
The [=deserialization steps=], given |serialized| and |value|, are:
147+
The [=deserialization steps=], given |serialized|, |value|, and |targetRealm| are:
155148

156149
1. Let |bytes| be the [=sub-deserialization=] of |serialized|.\[[Bytes]].
157150

0 commit comments

Comments
 (0)