From 980c1bcab64b7f694e16c94bf587cdfcfd9d8467 Mon Sep 17 00:00:00 2001 From: Ben Smith Date: Thu, 26 Mar 2020 12:02:20 -0700 Subject: [PATCH] Throw TypeError for shared memory w/o maximum (#154) Instead of RangeError. Fixes #153. --- document/js-api/index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/document/js-api/index.bs b/document/js-api/index.bs index 6c070311..9f3da9ae 100644 --- a/document/js-api/index.bs +++ b/document/js-api/index.bs @@ -657,7 +657,7 @@ which can be simultaneously referenced by multiple {{Instance}} objects. Each 1. If |descriptor|["maximum"] is [=present=], let |maximum| be |descriptor|["maximum"]; otherwise, let |maximum| be empty. 1. If |maximum| is not empty and |maximum| < |initial|, throw a {{RangeError}} exception. 1. Let |shared| be |descriptor|["shared"]. - 1. If |shared| is true and |maximum| is empty, throw a {{RangeError}} exception. + 1. If |shared| is true and |maximum| is empty, throw a {{TypeError}} exception. 1. Let |memtype| be { min |initial|, max |maximum|, shared |shared| } 1. Let |store| be the [=surrounding agent=]'s [=associated store=]. 1. Let (|store|, |memaddr|) be [=mem_alloc=](|store|, |memtype|). If allocation fails, throw a {{RangeError}} exception.