You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -355,9 +358,9 @@ A {{Module}} object represents a single WebAssembly module. Each {{Module}} obje
355
358
1. If |module|.[=imports=][=list/is empty|is not empty=], and |importObject| is undefined, throw a {{TypeError}} exception.
356
359
1. Let |imports| be « ».
357
360
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|).
359
362
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|).
361
364
1. If |externtype| is of the form [=func=] |functype|,
362
365
1. If [=IsCallable=](|v|) is false, throw a {{LinkError}} exception.
363
366
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
403
406
404
407
<div algorithm>
405
408
To <dfn>create an exports object</dfn> from a WebAssembly module |module| and instance |instance|, perform the following steps:
406
-
1. Let |exportsObject| be .
409
+
1. Let |exportsObject| be [=!=][=ObjectCreate=](null).
407
410
1. [=list/iterate|For each=] (|name|, |externtype|) of [=module_exports=](|module|),
408
411
1. Let |externval| be [=instance_export=](|instance|, |name|).
409
412
1. Assert: |externval| is not [=error=].
@@ -427,11 +430,11 @@ The verification of WebAssembly type requirements is deferred to the
427
430
1. Let [=external value|table=] |tableaddr| be |externval|.
428
431
1. Let |table| be [=create a Table object|a new Table object=] created from |tableaddr|.
429
432
1. Let |value| be |table|.
430
-
1. Let |status| be .
433
+
1. Let |status| be [=!=][=CreateDataProperty=](|exportsObject|, |name|, |value|).
431
434
1. Assert: |status| is true.
432
435
433
436
Note: the validity and uniqueness checks performed during [=WebAssembly module validation=] ensure that each property name is valid and no properties are defined twice.
1. Let |buffer| be the result of [=create a memory buffer|creating a memory buffer=] from |memaddr|.
692
695
1. Set |memory|.\[[BufferObject]] to |buffer|.
693
696
</div>
@@ -777,7 +780,7 @@ Each {{Table}} object has a \[[Table]] internal slot, which is a [=table address
777
780
1. If |value| is missing,
778
781
1. Let |ref| be [=DefaultValue=](|elementType|).
779
782
1. Otherwise,
780
-
1. Let |ref| be ?[=ToWebAssemblyValue=](|value|, |elementType|).
783
+
1. Let |ref| be [=?=][=ToWebAssemblyValue=](|value|, |elementType|).
781
784
1. Let |type| be the [=table type=] {[=table type|min=] |initial|, [=table type|max=] |maximum|} |elementType|.
782
785
1. Let |store| be the [=surrounding agent=]'s [=associated store=].
783
786
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
794
797
1. If |value| is missing,
795
798
1. Let |ref| be [=DefaultValue=](|elementType|).
796
799
1. Otherwise,
797
-
1. Let |ref| be ?[=ToWebAssemblyValue=](|value|, |elementType|).
800
+
1. Let |ref| be [=?=][=ToWebAssemblyValue=](|value|, |elementType|).
798
801
1. Let |result| be [=table_grow=](|store|, |tableaddr|, |delta|, |ref|).
799
802
1. If |result| is [=error=], throw a {{RangeError}} exception.
800
803
@@ -827,7 +830,7 @@ Each {{Table}} object has a \[[Table]] internal slot, which is a [=table address
827
830
1. If |value| is missing,
828
831
1. Let |ref| be [=DefaultValue=](|elementType|).
829
832
1. Otherwise,
830
-
1. Let |ref| be ?[=ToWebAssemblyValue=](|value|, |elementType|).
833
+
1. Let |ref| be [=?=][=ToWebAssemblyValue=](|value|, |elementType|).
831
834
1. Let |store| be the [=surrounding agent=]'s [=associated store=].
832
835
1. Let |store| be [=table_write=](|store|, |tableaddr|, |index|, |ref|).
833
836
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 [
977
980
1. Let |moduleinst| be |funcinst|.module.
978
981
1. Assert: |funcaddr| is contained in |moduleinst|.funcaddrs.
979
982
1. Let |index| be the index of |moduleinst|.funcaddrs where |funcaddr| is found.
980
-
1. Return .
983
+
1. Return [=!=][=ToString=](|index|).
981
984
</div>
982
985
983
986
<div algorithm>
@@ -1004,7 +1007,7 @@ This slot holds a [=function address=] relative to the [=surrounding agent=]'s [
1004
1007
1005
1008
1. Let |store| be the [=surrounding agent=]'s [=associated store=].
1006
1009
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|.
1008
1011
1. If |parameters| or |results| contain [=v128=], throw a {{TypeError}}.
1009
1012
1010
1013
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
1035
1038
<div algorithm>
1036
1039
To <dfn>run a host function</dfn> from the JavaScript object |func|, type |functype|, and [=list=] of [=WebAssembly values=] |arguments|, perform the following steps:
1037
1040
1038
-
1. Let [<var ignore>parameters</var>] → [|results|] be |functype|.
1041
+
1. Let [|parameters|] → [|results|] be |functype|.
1039
1042
1. If |parameters| or |results| contain [=v128=], throw a {{TypeError}}.
1040
1043
1. Let |jsArguments| be « ».
1041
1044
1. [=list/iterate|For each=] |arg| of |arguments|,
1042
-
1. [=list/Append=] 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|).
1044
1047
1. Let |resultsSize| be |results|'s [=list/size=].
1045
1048
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]) ».
1047
1050
1. Otherwise,
1048
-
1. Let |method| be ?[=GetMethod=](|ret|, [=@@iterator=]).
1051
+
1. Let |method| be [=?=][=GetMethod=](|ret|, [=@@iterator=]).
1049
1052
1. If |method| is undefined, [=throw=] a {{TypeError}}.
1050
-
1. Let |values| be ?[=IterableToList=](|ret|, |method|).
1053
+
1. Let |values| be [=?=][=IterableToList=](|ret|, |method|).
1051
1054
1. Let |wasmValues| be a new, empty [=list=].
1052
1055
1. If |values|'s [=list/size=] is not |resultsSize|, throw a {{TypeError}} exception.
1053
1056
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
1109
1112
1110
1113
1. Assert: |type| is not [=v128=].
1111
1114
1. If |type| is [=i64=],
1112
-
1. Let |i64| be ?[=ToBigInt64=](|v|).
1115
+
1. Let |i64| be [=?=][=ToBigInt64=](|v|).
1113
1116
1. Return [=i64.const=] |i64|.
1114
1117
1. If |type| is [=i32=],
1115
-
1. Let |i32| be ?[=ToInt32=](|v|).
1118
+
1. Let |i32| be [=?=][=ToInt32=](|v|).
1116
1119
1. Return [=i32.const=] |i32|.
1117
1120
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.
1119
1122
1. Return [=f32.const=] |f32|.
1120
1123
1. If |type| is [=f64=],
1121
-
1. Let |f64| be ?[=ToNumber=](|v|).
1124
+
1. Let |f64| be [=?=][=ToNumber=](|v|).
1122
1125
1. Return [=f64.const=] |f64|.
1123
1126
1. If |type| is [=funcref=],
1124
1127
1. If |v| is null,
@@ -1150,7 +1153,7 @@ When the [=namespace object=] for the {{WebAssembly}} namespace is [=create a na
1150
1153
1. Let |namespaceObject| be the [=namespace object=].
1151
1154
1. [=list/iterate|For each=] |error| of « "CompileError", "LinkError", "RuntimeError" »,
1152
1155
1. Let |constructor| be a new object, implementing the [=NativeError Object Structure=], with <var ignore>NativeError</var> set to |error|.
0 commit comments