@@ -766,8 +766,10 @@ which can be simultaneously referenced by multiple {{Instance}} objects. Each
766
766
1. let |initial| be |descriptor|["initial"] .
767
767
1. If |descriptor|["maximum"] is [=present=] , let |maximum| be |descriptor|["maximum"] ; otherwise, let |maximum| be empty.
768
768
1. If |maximum| is not empty and |maximum| < |initial|, throw a {{RangeError}} exception.
769
- 1. If |value| is missing, set |value| to [=DefaultValue=] (|elementType|).
770
- 1. Let |ref| be ? [=ToWebAssemblyValue=] (|value|, |elementType|).
769
+ 1. If |value| is missing,
770
+ 1. Let |ref| be [=DefaultValue=] (|elementType|).
771
+ 1. Otherwise,
772
+ 1. Let |ref| be ? [=ToWebAssemblyValue=] (|value|, |elementType|).
771
773
1. Let |type| be the [=table type=] {[=table type|𝗆𝗂𝗇=] |initial|, [=table type|𝗆𝖺𝗑=] |maximum|} |elementType|.
772
774
1. Let |store| be the [=surrounding agent=] 's [=associated store=] .
773
775
1. Let (|store|, |tableaddr|) be [=table_alloc=] (|store|, |type|, |ref|). <!-- TODO(littledan): Report allocation failure https://github.com/WebAssembly/spec/issues/584 -->
@@ -783,8 +785,10 @@ which can be simultaneously referenced by multiple {{Instance}} objects. Each
783
785
1. Let |initialSize| be the length of **this**.\[[Values]] .
784
786
1. Let |store| be the [=surrounding agent=] 's [=associated store=] .
785
787
1. Let (<var ignore> limits</var> , |elementType|) be [=table_type=] (|tableaddr|).
786
- 1. If |value| is missing, set |value| to [=DefaultValue=] (|elementType|).
787
- 1. Let |ref| be ? [=ToWebAssemblyValue=] (|value|, |elementType|).
788
+ 1. If |value| is missing,
789
+ 1. Let |ref| be [=DefaultValue=] (|elementType|).
790
+ 1. Otherwise,
791
+ 1. Let |ref| be ? [=ToWebAssemblyValue=] (|value|, |elementType|).
788
792
1. Let |result| be [=table_grow=] (|store|, |tableaddr|, |delta|, |ref|).
789
793
1. If |result| is [=error=] , throw a {{RangeError}} exception.
790
794
@@ -812,8 +816,10 @@ which can be simultaneously referenced by multiple {{Instance}} objects. Each
812
816
1. Let |tableaddr| be **this**.\[[Table]] .
813
817
1. Let |values| be **this**.\[[Values]] .
814
818
1. Let (<var ignore> limits</var> , |elementType|) be [=table_type=] (|tableaddr|).
815
- 1. If |value| is missing, set |value| to [=DefaultValue=] (|elementType|).
816
- 1. Let |ref| be ? [=ToWebAssemblyValue=] (|value|, |elementType|).
819
+ 1. If |value| is missing,
820
+ 1. Let |ref| be [=DefaultValue=] (|elementType|).
821
+ 1. Otherwise,
822
+ 1. Let |ref| be ? [=ToWebAssemblyValue=] (|value|, |elementType|).
817
823
1. Let |store| be the [=surrounding agent=] 's [=associated store=] .
818
824
1. Let |store| be [=table_write=] (|store|, |tableaddr|, |index|, |ref|).
819
825
1. If |store| is [=error=] , throw a {{RangeError}} exception.
0 commit comments