diff --git a/document/js-api/index.bs b/document/js-api/index.bs
index 35a591fc2e..79ccedfb17 100644
--- a/document/js-api/index.bs
+++ b/document/js-api/index.bs
@@ -740,14 +740,9 @@ interface Table {
};
-
-A {{Table}} object represents a single [=table instance=]
-which can be simultaneously referenced by multiple {{Instance}} objects.
-Each {{Table}} object has the following internal slots:
-
- * \[[Table]] : a [=table address=]
- * \[[Values]] : a [=list=] whose elements depend on the element type of \[[Table]]'s [=table type=].
-
+A {{Table}} object represents a single [=table instance=] which can be simultaneously referenced by
+multiple {{Instance}} objects.
+Each {{Table}} object has a \[[Table]] internal slot, which is a [=table address=].
To
initialize a table object |table| from a [=table address=] |tableaddr|, perform the following steps:
@@ -770,7 +765,7 @@ Each {{Table}} object has the following internal slots:
The Table(|descriptor|, |value|) constructor, when invoked, performs the following steps:
1. Let |elementType| be [=ToValueType=](|descriptor|["element"]).
- 1. let |initial| be |descriptor|["initial"].
+ 1. Let |initial| be |descriptor|["initial"].
1. If |descriptor|["maximum"] [=map/exists=], let |maximum| be |descriptor|["maximum"]; otherwise, let |maximum| be empty.
1. If |maximum| is not empty and |maximum| < |initial|, throw a {{RangeError}} exception.
1. If |value| is missing,
@@ -782,8 +777,6 @@ Each {{Table}} object has the following internal slots:
1. Let (|store|, |tableaddr|) be [=table_alloc=](|store|, |type|, |ref|).
1. Set the [=surrounding agent=]'s [=associated store=] to |store|.
1. [=initialize a table object|Initialize=] **this** from |tableaddr|.
- 1. [=list/Empty=] **this**.\[[Values]].
- 1. [=list/Append=] |value| to **this**.\[[Values]] |initial| times.
@@ -802,7 +795,6 @@ Each {{Table}} object has the following internal slots:
Note: The above exception can happen due to either insufficient memory or an invalid size parameter.
1. Set the [=surrounding agent=]'s [=associated store=] to |result|.
- 1. [=list/Append=] |value| to **this**.\[[Values]] |delta| times.
1. Return |initialSize|.
@@ -819,14 +811,12 @@ Each {{Table}} object has the following internal slots:
1. Let |store| be the [=surrounding agent=]'s [=associated store=].
1. Let |result| be [=table_read=](|store|, |tableaddr|, |index|).
1. If |result| is [=error=], throw a {{RangeError}} exception.
- 1. Let |function| be the result of creating [=a new Exported Function=] from |result|.
- 1. Return |function|.
+ 1. Return [=ToJSValue=](|result|).
The set(|index|, |value|) method, when invoked, performs the following steps:
1. Let |tableaddr| be **this**.\[[Table]].
- 1. Let |values| be **this**.\[[Values]].
1. Let (limits, |elementType|) be [=table_type=](|tableaddr|).
1. If |value| is missing,
1. Let |ref| be [=DefaultValue=](|elementType|).
@@ -897,7 +887,7 @@ which can be simultaneously referenced by multiple {{Instance}} objects. Each
1. If |s| equals "i64", return [=i64=].
1. If |s| equals "f32", return [=f32=].
1. If |s| equals "f64", return [=f64=].
- 1. If |s| equals "funcref", return [=funcref=].
+ 1. If |s| equals "anyfunc", return [=funcref=].
1. If |s| equals "externref", return [=externref=].
1. Assert: This step is not reached.
@@ -908,6 +898,7 @@ which can be simultaneously referenced by multiple {{Instance}} objects. Each
1. If |valuetype| equals [=i64=], return [=i64.const=] 0.
1. If |valuetype| equals [=f32=], return [=f32.const=] 0.
1. If |valuetype| equals [=f64=], return [=f64.const=] 0.
+ 1. If |valuetype| equals [=funcref=], return [=ref.null=] [=funcref=].
1. If |valuetype| equals [=externref=], return [=ToWebAssemblyValue=](undefined, |valuetype|).
1. Assert: This step is not reached.
@@ -917,7 +908,7 @@ which can be simultaneously referenced by multiple {{Instance}} objects. Each
1. Let |mutable| be |descriptor|["mutable"].
1. Let |valuetype| be [=ToValueType=](|descriptor|["value"]).
1. If |v| is missing,
- 1. let |value| be [=DefaultValue=](|valuetype|).
+ 1. Let |value| be [=DefaultValue=](|valuetype|).
1. Otherwise,
1. Let |value| be [=ToWebAssemblyValue=](|v|, |valuetype|).
1. If |mutable| is true, let |globaltype| be [=var=] |valuetype|; otherwise, let |globaltype| be [=const=] |valuetype|.
@@ -1088,10 +1079,13 @@ Note: Number values which are equal to NaN may have various observable NaN paylo
- For retrieving an extern value from a [=extern address=] |externaddr|, perform the following steps:
- 1. Let |map| be the [=surrounding agent=]'s associated [=extern value cache=].
- 1. Assert: |map|[|externaddr|] [=map/exists=].
- 1. Return |map|[|externaddr|].
+
+For retrieving an extern value from an [=extern address=] |externaddr|, perform the following steps:
+
+1. Let |map| be the [=surrounding agent=]'s associated [=extern value cache=].
+1. Assert: |map|[|externaddr|] [=map/exists=].
+1. Return |map|[|externaddr|].
+
@@ -1129,7 +1123,6 @@ The algorithm ToWebAssemblyValue(|v|, |type|) coerces a JavaScript va
-
Error Objects
WebAssembly defines the following Error classes: CompileError, LinkError, and RuntimeError.