Skip to content

Commit

Permalink
[spec] Throw consistent exns in "read the imports"
Browse files Browse the repository at this point in the history
Instead of allowing ToWebAssemblyValue to throw a TypeError, explicitly catch
any exceptions and throw a WebAssembly.LinkError.
  • Loading branch information
takikawa committed Feb 15, 2024
1 parent 6b9b1e2 commit d9302a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion document/js-api/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ A {{Module}} object represents a single WebAssembly module. Each {{Module}} obje
1. Throw a {{LinkError}} exception.
1. If |valtype| is [=v128=],
1. Throw a {{LinkError}} exception.
1. Let |value| be [=ToWebAssemblyValue=](|v|, |valtype|).
1. Let |value| be [=ToWebAssemblyValue=](|v|, |valtype|). If this operation throws an exception, catch it, and throw a {{LinkError}} exception.
1. Let |store| be the [=surrounding agent=]'s [=associated store=].
1. Let (|store|, |globaladdr|) be [=global_alloc=](|store|, [=const=] |valtype|, |value|).
1. Set the [=surrounding agent=]'s [=associated store=] to |store|.
Expand Down

0 comments on commit d9302a8

Please sign in to comment.