diff --git a/document/js-api/index.bs b/document/js-api/index.bs index 2e03669ad9..4afb150133 100644 --- a/document/js-api/index.bs +++ b/document/js-api/index.bs @@ -1473,10 +1473,11 @@ The algorithm ToWebAssemblyValue(|v|, |type|) coerces a JavaScript va 1. Else, 1. Let |map| be the [=surrounding agent=]'s associated [=host value cache=]. 1. If a [=host address=] |hostaddr| exists such that |map|[|hostaddr|] is the same as |v|, - 1. Return [=ref.host=] |hostaddr|. - 1. Let |hostaddr| be the smallest [=host address=] such that |map|[|hostaddr|] [=map/exists=] is false. - 1. [=map/Set=] |map|[|hostaddr|] to |v|. - 1. Let |r| be [=ref.host=] |hostaddr|. + 1. Let |r| be [=ref.host=] |hostaddr|. + 1. Else, + 1. Let |hostaddr| be the smallest [=host address=] such that |map|[|hostaddr|] [=map/exists=] is false. + 1. [=map/Set=] |map|[|hostaddr|] to |v|. + 1. Let |r| be [=ref.host=] |hostaddr|. 1. Let |store| be the [=surrounding agent=]'s [=associated store=]. 1. Let |actualtype| be [=ref_type=](|store|, |r|). 1. If [=match_valtype=](|actualtype|, |type|) is false,