From 465cf4a5c080c052c51b63660f620ae40adf79a9 Mon Sep 17 00:00:00 2001 From: Shu-yu Guo Date: Mon, 19 Sep 2022 20:45:26 -0400 Subject: [PATCH] Fix resizable ArrayBuffer subarray tests (#3671) This is from the normative change in https://github.com/tc39/proposal-resizablearraybuffer/pull/93, which got consensus in the March 2022 TC39. --- .../resizable/subarray-parameter-conversion-grows.js | 3 ++- .../resizable/subarray-parameter-conversion-shrinks.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/test/staging/ArrayBuffer/resizable/subarray-parameter-conversion-grows.js b/test/staging/ArrayBuffer/resizable/subarray-parameter-conversion-grows.js index c1597171ea..5a2c7ba47d 100644 --- a/test/staging/ArrayBuffer/resizable/subarray-parameter-conversion-grows.js +++ b/test/staging/ArrayBuffer/resizable/subarray-parameter-conversion-grows.js @@ -127,7 +127,8 @@ for (let ctor of ctors) { return 0; } }; - assert.compareArray(ToNumbers(lengthTracking.subarray(evil)), [ + assert.compareArray( + ToNumbers(lengthTracking.subarray(evil, lengthTracking.length)), [ 0, 2, 4, diff --git a/test/staging/ArrayBuffer/resizable/subarray-parameter-conversion-shrinks.js b/test/staging/ArrayBuffer/resizable/subarray-parameter-conversion-shrinks.js index 502f63cc73..a282302d1c 100644 --- a/test/staging/ArrayBuffer/resizable/subarray-parameter-conversion-shrinks.js +++ b/test/staging/ArrayBuffer/resizable/subarray-parameter-conversion-shrinks.js @@ -167,7 +167,7 @@ for (let ctor of ctors) { } }; assert.throws(RangeError, () => { - lengthTracking.subarray(evil); + lengthTracking.subarray(evil, lengthTracking.length); }); }