spec
spec copied to clipboard
[js-api] Fix up missing preconditions on allocations
Adds explicit steps to run memtype and tabletype validation and throw a RangeError on failure. This explicitly satisfies the preconditions from the wasm embedding spec, and removes the need for the initial <= maximum check in the JS API spec.
One other small note: allocation failures on tables are now explicitly reported. This captures implementation limits on table length, which also weren't quite handled by the spec. (This removes a TODO referencing #584.)
Fixes #1792.