Browse Source

Update ArrayBuffer, DataView and TypedArray related tests (#926)

Marko Lahma 4 years ago
parent
commit
e90e4b3cc9
100 changed files with 1781 additions and 91 deletions
  1. 6 3
      Jint.Tests.Test262/Test262Test.cs
  2. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/Symbol.species/length.js
  3. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/Symbol.species/return-value.js
  4. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/Symbol.species/symbol-species-name.js
  5. 1 2
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/Symbol.species/symbol-species.js
  6. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/allocation-limit.js
  7. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/data-allocation-after-object-creation.js
  8. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/init-zero.js
  9. 24 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/is-a-constructor.js
  10. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/isView/length.js
  11. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/isView/name.js
  12. 29 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/isView/not-a-constructor.js
  13. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/length-is-too-large-throws.js
  14. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/newtarget-prototype-is-not-object.js
  15. 22 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/options-maxbytelength-diminuitive.js
  16. 28 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/options-maxbytelength-excessive.js
  17. 25 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/options-maxbytelength-negative.js
  18. 45 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/options-maxbytelength-object.js
  19. 29 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/options-maxbytelength-poisoned.js
  20. 24 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/options-maxbytelength-undefined.js
  21. 27 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/options-non-object.js
  22. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/proto-from-ctor-realm.js
  23. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype-from-newtarget.js
  24. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/Symbol.toStringTag.js
  25. 4 8
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/byteLength/detached-buffer.js
  26. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/byteLength/invoked-as-accessor.js
  27. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/byteLength/invoked-as-func.js
  28. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/byteLength/length.js
  29. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/byteLength/name.js
  30. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/byteLength/prop-desc.js
  31. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/byteLength/return-bytelength.js
  32. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/byteLength/this-has-no-typedarrayname-internal.js
  33. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/byteLength/this-is-not-object.js
  34. 11 4
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/byteLength/this-is-sharedarraybuffer.js
  35. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/constructor.js
  36. 22 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/maxByteLength/detached-buffer.js
  37. 17 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/maxByteLength/invoked-as-accessor.js
  38. 23 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/maxByteLength/invoked-as-func.js
  39. 13 13
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/maxByteLength/length.js
  40. 24 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/maxByteLength/name.js
  41. 25 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/maxByteLength/prop-desc.js
  42. 25 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/maxByteLength/return-maxbytelength-non-resizable.js
  43. 28 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/maxByteLength/return-maxbytelength-resizable.js
  44. 39 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/maxByteLength/this-has-no-arraybufferdata-internal.js
  45. 48 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/maxByteLength/this-is-not-object.js
  46. 33 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/maxByteLength/this-is-sharedarraybuffer.js
  47. 34 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resizable/detached-buffer.js
  48. 17 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resizable/invoked-as-accessor.js
  49. 23 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resizable/invoked-as-func.js
  50. 32 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resizable/length.js
  51. 24 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resizable/name.js
  52. 25 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resizable/prop-desc.js
  53. 29 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resizable/return-resizable.js
  54. 39 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resizable/this-has-no-arraybufferdata-internal.js
  55. 15 16
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resizable/this-is-not-object.js
  56. 33 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resizable/this-is-sharedarraybuffer.js
  57. 22 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/descriptor.js
  58. 15 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/extensible.js
  59. 30 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/length.js
  60. 27 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/name.js
  61. 25 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/new-length-excessive.js
  62. 25 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/new-length-negative.js
  63. 37 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/new-length-non-number.js
  64. 25 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/nonconstructor.js
  65. 77 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/resize-grow.js
  66. 78 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/resize-same-size-zero-explicit.js
  67. 78 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/resize-same-size-zero-implicit.js
  68. 78 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/resize-same-size.js
  69. 77 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/resize-shrink-zero-explicit.js
  70. 77 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/resize-shrink-zero-implicit.js
  71. 77 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/resize-shrink.js
  72. 27 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/this-is-detached.js
  73. 28 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/this-is-not-arraybuffer-object.js
  74. 44 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/this-is-not-object.js
  75. 38 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/this-is-not-resizable-arraybuffer-object.js
  76. 20 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/this-is-sharedarraybuffer.js
  77. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/context-is-not-arraybuffer-object.js
  78. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/context-is-not-object.js
  79. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/descriptor.js
  80. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/end-default-if-absent.js
  81. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/end-default-if-undefined.js
  82. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/end-exceeds-length.js
  83. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/extensible.js
  84. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/length.js
  85. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/name.js
  86. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/negative-end.js
  87. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/negative-start.js
  88. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/nonconstructor.js
  89. 33 0
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/not-a-constructor.js
  90. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/number-conversion.js
  91. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/species-constructor-is-not-object.js
  92. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/species-constructor-is-undefined.js
  93. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/species-is-not-constructor.js
  94. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/species-is-not-object.js
  95. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/species-is-null.js
  96. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/species-is-undefined.js
  97. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/species-returns-larger-arraybuffer.js
  98. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/species-returns-not-arraybuffer.js
  99. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/species-returns-same-arraybuffer.js
  100. 0 1
      Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/species-returns-smaller-arraybuffer.js

+ 6 - 3
Jint.Tests.Test262/Test262Test.cs

@@ -65,7 +65,9 @@ namespace Jint.Tests.Test262
                 "compareIterator.js",
                 "nativeFunctionMatcher.js",
                 "wellKnownIntrinsicObjects.js",
-                "fnGlobalObject.js"
+                "fnGlobalObject.js",
+                "testTypedArray.js",
+                "detachArrayBuffer.js"
             };
 
             Sources = new Dictionary<string, Script>(files.Length);
@@ -114,7 +116,8 @@ namespace Jint.Tests.Test262
                     var script = parser.ParseScript(strict);
 
                     return engine.Evaluate(script);
-                }), true, true, true));   
+                }), true, true, true));
+
             o.FastSetProperty("createRealm", new PropertyDescriptor(new ClrFunctionInstance(engine, "createRealm",
                 (thisObj, args) =>
                 {
@@ -318,7 +321,7 @@ namespace Jint.Tests.Test262
                     skip = true;
                     reason = "TypedArray not implemented";
                 }
-                
+
                 if (name.StartsWith("language/statements/class/subclass/builtin-objects/ArrayBuffer/"))
                 {
                     skip = true;

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/Symbol.species/length.js

@@ -3,7 +3,6 @@
 
 /*---
 esid: sec-get-arraybuffer-@@species
-es6id: 24.1.3.3
 description: >
   get ArrayBuffer [ @@species ].length is 0.
 info: |

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/Symbol.species/return-value.js

@@ -2,7 +2,6 @@
 // This code is governed by the BSD license found in the LICENSE file.
 /*---
 esid: sec-get-arraybuffer-@@species
-es6id: 24.1.3.3
 description: Return value of @@species accessor method
 info: |
     1. Return the this value.

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/Symbol.species/symbol-species-name.js

@@ -2,7 +2,6 @@
 // This code is governed by the BSD license found in the LICENSE file.
 /*---
 esid: sec-get-arraybuffer-@@species
-es6id: 24.1.3.3
 description: >
   ArrayBuffer[Symbol.species] accessor property get name
 info: |

+ 1 - 2
Jint.Tests.Test262/test/built-ins/ArrayBuffer/Symbol.species/symbol-species.js

@@ -5,10 +5,9 @@
 info: |
  ArrayBuffer has a property at `Symbol.species`
 esid: sec-get-arraybuffer-@@species
-es6id: 24.1.3.3
 author: Sam Mikes
 description: ArrayBuffer[Symbol.species] exists per spec
-features: [ ArrayBuffer, Symbol.species ]
+features: [ArrayBuffer, Symbol.species]
 includes: [propertyHelper.js]
 ---*/
 

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/allocation-limit.js

@@ -3,7 +3,6 @@
 
 /*---
 esid: sec-arraybuffer-length
-es6id: 24.1.2.1
 description: >
   Throws a RangeError if requested Data Block is too large.
 info: |

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/data-allocation-after-object-creation.js

@@ -3,7 +3,6 @@
 
 /*---
 esid: sec-arraybuffer-length
-es6id: 24.1.2.1
 description: >
   The new ArrayBuffer instance is created prior to allocating the Data Block.
 info: |

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/init-zero.js

@@ -2,7 +2,6 @@
 // This code is governed by the BSD license found in the LICENSE file.
 /*---
 esid: sec-arraybuffer-length
-es6id: 24.1.1.1
 description: All bytes are initialized to zero
 info: |
     [...]

+ 24 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/is-a-constructor.js

@@ -0,0 +1,24 @@
+// Copyright (C) 2020 Rick Waldron. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-ecmascript-standard-built-in-objects
+description: >
+  The ArrayBuffer constructor implements [[Construct]]
+info: |
+  IsConstructor ( argument )
+
+  The abstract operation IsConstructor takes argument argument (an ECMAScript language value).
+  It determines if argument is a function object with a [[Construct]] internal method.
+  It performs the following steps when called:
+
+  If Type(argument) is not Object, return false.
+  If argument has a [[Construct]] internal method, return true.
+  Return false.
+includes: [isConstructor.js]
+features: [Reflect.construct, ArrayBuffer]
+---*/
+
+assert.sameValue(isConstructor(ArrayBuffer), true, 'isConstructor(ArrayBuffer) must return true');
+new ArrayBuffer();
+  

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/isView/length.js

@@ -3,7 +3,6 @@
 
 /*---
 esid: sec-arraybuffer.isview
-es6id: 24.1.3.1
 description: >
   ArrayBuffer.isView.length is 1.
 info: |

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/isView/name.js

@@ -3,7 +3,6 @@
 
 /*---
 esid: sec-arraybuffer.isview
-es6id: 24.1.3.1
 description: >
   ArrayBuffer.isView.name is "isView".
 info: |

+ 29 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/isView/not-a-constructor.js

@@ -0,0 +1,29 @@
+// Copyright (C) 2020 Rick Waldron. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-ecmascript-standard-built-in-objects
+description: >
+  ArrayBuffer.isView does not implement [[Construct]], is not new-able
+info: |
+  ECMAScript Function Objects
+
+  Built-in function objects that are not identified as constructors do not
+  implement the [[Construct]] internal method unless otherwise specified in
+  the description of a particular function.
+
+  sec-evaluatenew
+
+  ...
+  7. If IsConstructor(constructor) is false, throw a TypeError exception.
+  ...
+includes: [isConstructor.js]
+features: [Reflect.construct, ArrayBuffer, arrow-function]
+---*/
+
+assert.sameValue(isConstructor(ArrayBuffer.isView), false, 'isConstructor(ArrayBuffer.isView) must return false');
+
+assert.throws(TypeError, () => {
+  new ArrayBuffer.isView();
+}, '`new ArrayBuffer.isView()` throws TypeError');
+

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/length-is-too-large-throws.js

@@ -2,7 +2,6 @@
 // This code is governed by the BSD license found in the LICENSE file.
 
 /*---
-es6id: 24.1.2.1
 esid: sec-arraybuffer-length
 description: >
   Throws a RangeError if length >= 2 ** 53

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/newtarget-prototype-is-not-object.js

@@ -3,7 +3,6 @@
 
 /*---
 esid: sec-arraybuffer-length
-es6id: 24.1.2.1
 description: >
   [[Prototype]] defaults to %ArrayBufferPrototype% if NewTarget.prototype is not an object.
 info: |

+ 22 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/options-maxbytelength-diminuitive.js

@@ -0,0 +1,22 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-arraybuffer-constructor
+description: |
+  Invoked with an options object whose `maxByteLength` property is less than
+  the length.
+info: |
+  ArrayBuffer( length [ , options ] )
+
+  1. If NewTarget is undefined, throw a TypeError exception.
+  2. Let byteLength be ? ToIndex(length).
+  3. Let requestedMaxByteLength be ? GetArrayBufferMaxByteLengthOption(options).
+  4. If requestedMaxByteLength is empty, then
+     a. [...]
+  5. If byteLength > requestedMaxByteLength, throw a RangeError exception.
+features: [resizable-arraybuffer]
+---*/
+
+assert.throws(RangeError, function() {
+  new ArrayBuffer(1, {maxByteLength: 0});
+});

+ 28 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/options-maxbytelength-excessive.js

@@ -0,0 +1,28 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-arraybuffer-constructor
+description: |
+  Invoked with an options object whose `maxByteLength` property exceeds the
+  maximum length value
+info: |
+  ArrayBuffer( length [ , options ] )
+
+  1. If NewTarget is undefined, throw a TypeError exception.
+  2. Let byteLength be ? ToIndex(length).
+  3. Let requestedMaxByteLength be ? GetArrayBufferMaxByteLengthOption(options).
+  [...]
+
+  1.1.5 GetArrayBufferMaxByteLengthOption ( options )
+
+  1. If Type(options) is not Object, return empty.
+  2. Let maxByteLength be ? Get(options, "maxByteLength").
+  3. If maxByteLength is undefined, return empty.
+  4. Return ? ToIndex(maxByteLength).
+features: [resizable-arraybuffer]
+---*/
+
+assert.throws(RangeError, function() {
+  // Math.pow(2, 53) = 9007199254740992
+  new ArrayBuffer(0, { maxByteLength: 9007199254740992 });
+});

+ 25 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/options-maxbytelength-negative.js

@@ -0,0 +1,25 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-arraybuffer-constructor
+description: Invoked with an options object whose `maxByteLength` property is negative
+info: |
+  ArrayBuffer( length [ , options ] )
+
+  1. If NewTarget is undefined, throw a TypeError exception.
+  2. Let byteLength be ? ToIndex(length).
+  3. Let requestedMaxByteLength be ? GetArrayBufferMaxByteLengthOption(options).
+  [...]
+
+  1.1.5 GetArrayBufferMaxByteLengthOption ( options )
+
+  1. If Type(options) is not Object, return empty.
+  2. Let maxByteLength be ? Get(options, "maxByteLength").
+  3. If maxByteLength is undefined, return empty.
+  4. Return ? ToIndex(maxByteLength).
+features: [resizable-arraybuffer]
+---*/
+
+assert.throws(RangeError, function() {
+  new ArrayBuffer(0, { maxByteLength: -1 });
+});

+ 45 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/options-maxbytelength-object.js

@@ -0,0 +1,45 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-arraybuffer-constructor
+description: |
+  Invoked with an options object whose `maxByteLength` property cannot be
+  coerced to a primitive value
+info: |
+  ArrayBuffer( length [ , options ] )
+
+  1. If NewTarget is undefined, throw a TypeError exception.
+  2. Let byteLength be ? ToIndex(length).
+  3. Let requestedMaxByteLength be ? GetArrayBufferMaxByteLengthOption(options).
+  [...]
+
+  1.1.5 GetArrayBufferMaxByteLengthOption ( options )
+
+  1. If Type(options) is not Object, return empty.
+  2. Let maxByteLength be ? Get(options, "maxByteLength").
+  3. If maxByteLength is undefined, return empty.
+  4. Return ? ToIndex(maxByteLength).
+features: [resizable-arraybuffer]
+---*/
+
+var log = [];
+var options = {
+  maxByteLength: {
+    toString: function() {
+      log.push('toString');
+      return {};
+    },
+    valueOf: function() {
+      log.push('valueOf');
+      return {};
+    }
+  }
+};
+
+assert.throws(TypeError, function() {
+  new ArrayBuffer(0, options);
+});
+
+assert.sameValue(log.length, 2);
+assert.sameValue(log[0], 'valueOf');
+assert.sameValue(log[1], 'toString');

+ 29 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/options-maxbytelength-poisoned.js

@@ -0,0 +1,29 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-arraybuffer-constructor
+description: Invoked with an options object whose `maxByteLength` property throws
+info: |
+  ArrayBuffer( length [ , options ] )
+
+  1. If NewTarget is undefined, throw a TypeError exception.
+  2. Let byteLength be ? ToIndex(length).
+  3. Let requestedMaxByteLength be ? GetArrayBufferMaxByteLengthOption(options).
+  [...]
+
+  1.1.5 GetArrayBufferMaxByteLengthOption ( options )
+
+  1. If Type(options) is not Object, return empty.
+  2. Let maxByteLength be ? Get(options, "maxByteLength").
+features: [resizable-arraybuffer]
+---*/
+
+var options = {
+  get maxByteLength() {
+    throw new Test262Error();
+  }
+};
+
+assert.throws(Test262Error, function() {
+  new ArrayBuffer(0, options);
+});

+ 24 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/options-maxbytelength-undefined.js

@@ -0,0 +1,24 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-arraybuffer-constructor
+description: Invoked with an options object whose `maxByteLength` property is undefined
+info: |
+  ArrayBuffer( length [ , options ] )
+
+  1. If NewTarget is undefined, throw a TypeError exception.
+  2. Let byteLength be ? ToIndex(length).
+  3. Let requestedMaxByteLength be ? GetArrayBufferMaxByteLengthOption(options).
+  4. If requestedMaxByteLength is empty, then
+     a. Return ? AllocateArrayBuffer(NewTarget, byteLength).
+
+  1.1.5 GetArrayBufferMaxByteLengthOption ( options )
+
+  1. If Type(options) is not Object, return empty.
+  2. Let maxByteLength be ? Get(options, "maxByteLength").
+  3. If maxByteLength is undefined, return empty.
+features: [resizable-arraybuffer]
+---*/
+
+assert.sameValue(new ArrayBuffer(0, {}).resizable, false);
+assert.sameValue(new ArrayBuffer(0, {maxByteLength: undefined}).resizable, false);

+ 27 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/options-non-object.js

@@ -0,0 +1,27 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-arraybuffer-constructor
+description: Invoked with a non-object value for options
+info: |
+  ArrayBuffer( length [ , options ] )
+
+  1. If NewTarget is undefined, throw a TypeError exception.
+  2. Let byteLength be ? ToIndex(length).
+  3. Let requestedMaxByteLength be ? GetArrayBufferMaxByteLengthOption(options).
+  4. If requestedMaxByteLength is empty, then
+     a. Return ? AllocateArrayBuffer(NewTarget, byteLength).
+
+  1.1.5 GetArrayBufferMaxByteLengthOption ( options )
+
+  1. If Type(options) is not Object, return empty.
+features: [resizable-arraybuffer]
+---*/
+
+assert.sameValue(new ArrayBuffer(0, null).resizable, false, 'null');
+assert.sameValue(new ArrayBuffer(0, true).resizable, false, 'boolean');
+assert.sameValue(new ArrayBuffer(0, Symbol(3)).resizable, false, 'symbol');
+assert.sameValue(new ArrayBuffer(0, 1n).resizable, false, 'bigint');
+assert.sameValue(new ArrayBuffer(0, 'string').resizable, false, 'string');
+assert.sameValue(new ArrayBuffer(0, 9).resizable, false, 'number');
+assert.sameValue(new ArrayBuffer(0, undefined).resizable, false, 'undefined');

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/proto-from-ctor-realm.js

@@ -2,7 +2,6 @@
 // This code is governed by the BSD license found in the LICENSE file.
 /*---
 esid: sec-arraybuffer-length
-es6id: 24.1.1.1
 description: Default [[Prototype]] value derived from realm of the newTarget
 info: |
     [...]

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype-from-newtarget.js

@@ -3,7 +3,6 @@
 
 /*---
 esid: sec-arraybuffer-length
-es6id: 24.1.2.1
 description: >
   The [[Prototype]] internal slot is computed from NewTarget.
 info: |

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/Symbol.toStringTag.js

@@ -2,7 +2,6 @@
 // This code is governed by the BSD license found in the LICENSE file.
 /*---
 esid: sec-arraybuffer.prototype-@@tostringtag
-es6id: 24.1.4.4
 description: >
     `Symbol.toStringTag` property descriptor
 info: |

+ 4 - 8
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/byteLength/detached-buffer.js

@@ -1,23 +1,19 @@
 // Copyright (C) 2016 the V8 project authors. All rights reserved.
 // This code is governed by the BSD license found in the LICENSE file.
 /*---
-es6id: 24.1.4.1
 esid: sec-get-arraybuffer.prototype.bytelength
 description: Returns 0 if the buffer is detached
 info: |
-  24.1.4.1 get ArrayBuffer.prototype.byteLength
-
-  1. Let O be the this value.
+  get ArrayBuffer.prototype.byteLength
   ...
-  4. If IsDetachedBuffer(O) is true, throw a TypeError exception.
+  If IsDetachedBuffer(buffer) is true, return 0.
   ...
 includes: [detachArrayBuffer.js]
+features: [align-detached-buffer-semantics-with-web-reality]
 ---*/
 
 var ab = new ArrayBuffer(1);
 
 $DETACHBUFFER(ab);
 
-assert.throws(TypeError, function() {
-  ab.byteLength;
-});
+assert.sameValue(ab.byteLength, 0, 'The value of ab.byteLength is 0');

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/byteLength/invoked-as-accessor.js

@@ -1,7 +1,6 @@
 // Copyright (C) 2016 the V8 project authors. All rights reserved.
 // This code is governed by the BSD license found in the LICENSE file.
 /*---
-es6id: 24.1.4.1
 esid: sec-get-arraybuffer.prototype.bytelength
 description: Requires this value to have a [[ArrayBufferData]] internal slot
 info: |

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/byteLength/invoked-as-func.js

@@ -1,7 +1,6 @@
 // Copyright (C) 2016 the V8 project authors. All rights reserved.
 // This code is governed by the BSD license found in the LICENSE file.
 /*---
-es6id: 24.1.4.1
 esid: sec-get-arraybuffer.prototype.bytelength
 description: Throws a TypeError exception when invoked as a function
 info: |

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/byteLength/length.js

@@ -3,7 +3,6 @@
 
 /*---
 esid: sec-get-arraybuffer.prototype.bytelength
-es6id: 24.1.4.1
 description: >
   get ArrayBuffer.prototype.byteLength.length is 0.
 info: |

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/byteLength/name.js

@@ -2,7 +2,6 @@
 // This code is governed by the BSD license found in the LICENSE file.
 /*---
 esid: sec-get-arraybuffer.prototype.bytelength
-es6id: 24.1.4.1
 description: >
   get ArrayBuffer.prototype.byteLength
 

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/byteLength/prop-desc.js

@@ -1,7 +1,6 @@
 // Copyright (C) 2016 the V8 project authors. All rights reserved.
 // This code is governed by the BSD license found in the LICENSE file.
 /*---
-es6id: 24.1.4.1
 esid: sec-get-arraybuffer.prototype.bytelength
 description: >
   "byteLength" property of ArrayBuffer.prototype

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/byteLength/return-bytelength.js

@@ -1,7 +1,6 @@
 // Copyright (C) 2016 the V8 project authors. All rights reserved.
 // This code is governed by the BSD license found in the LICENSE file.
 /*---
-es6id: 24.1.4.1
 esid: sec-get-arraybuffer.prototype.bytelength
 description: Return value from [[ByteLength]] internal slot
 info: |

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/byteLength/this-has-no-typedarrayname-internal.js

@@ -1,7 +1,6 @@
 // Copyright (C) 2016 the V8 project authors. All rights reserved.
 // This code is governed by the BSD license found in the LICENSE file.
 /*---
-es6id: 24.1.4.1
 esid: sec-get-arraybuffer.prototype.bytelength
 description: >
   Throws a TypeError exception when `this` does not have a [[ArrayBufferData]]

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/byteLength/this-is-not-object.js

@@ -1,7 +1,6 @@
 // Copyright (C) 2016 the V8 project authors. All rights reserved.
 // This code is governed by the BSD license found in the LICENSE file.
 /*---
-es6id: 24.1.4.1
 esid: sec-get-arraybuffer.prototype.bytelength
 description: Throws a TypeError exception when `this` is not Object
 info: |

+ 11 - 4
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/byteLength/this-is-sharedarraybuffer.js

@@ -4,14 +4,21 @@
 /*---
 esid: sec-get-arraybuffer.prototype.bytelength
 description: Throws a TypeError exception when `this` is a SharedArrayBuffer
-features: [SharedArrayBuffer]
+features: [align-detached-buffer-semantics-with-web-reality, SharedArrayBuffer]
 ---*/
 
-var getter = Object.getOwnPropertyDescriptor(
+var byteLength = Object.getOwnPropertyDescriptor(
   ArrayBuffer.prototype, "byteLength"
-).get;
+);
+
+var getter = byteLength.get;
+var sab = new SharedArrayBuffer(4);
 
 assert.throws(TypeError, function() {
-  var sab = new SharedArrayBuffer(4);
   getter.call(sab);
 }, "`this` cannot be a SharedArrayBuffer");
+
+assert.throws(TypeError, function() {
+  Object.defineProperties(sab, { byteLength });
+  sab.byteLength;
+}, "`this` cannot be a SharedArrayBuffer");

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/constructor.js

@@ -3,7 +3,6 @@
 
 /*---
 esid: sec-arraybuffer.prototype.constructor
-es6id: 24.1.4.2
 description: >
   The `ArrayBuffer.prototype.constructor` property descriptor.
 info: |

+ 22 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/maxByteLength/detached-buffer.js

@@ -0,0 +1,22 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-get-arraybuffer.prototype.maxbytelength
+description: Returns 0 if the buffer is detached
+info: |
+  get ArrayBuffer.prototype.maxByteLength
+
+  1. Let O be the this value.
+  2. Perform ? RequireInternalSlot(O, [[ArrayBufferData]]).
+  3. If IsSharedArrayBuffer(O) is true, throw a TypeError exception.
+  4. If IsDetachedBuffer(O) is true, return +0𝔽.
+  [...]
+includes: [detachArrayBuffer.js]
+features: [resizable-arraybuffer]
+---*/
+
+var ab = new ArrayBuffer(1);
+
+$DETACHBUFFER(ab);
+
+assert.sameValue(ab.maxByteLength, 0);

+ 17 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/maxByteLength/invoked-as-accessor.js

@@ -0,0 +1,17 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-get-arraybuffer.prototype.maxbytelength
+description: Requires this value to have a [[ArrayBufferData]] internal slot
+info: |
+  get ArrayBuffer.prototype.maxByteLength
+
+  1. Let O be the this value.
+  2. Perform ? RequireInternalSlot(O, [[ArrayBufferData]]).
+  [...]
+features: [resizable-arraybuffer]
+---*/
+
+assert.throws(TypeError, function() {
+  ArrayBuffer.prototype.maxByteLength;
+});

+ 23 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/maxByteLength/invoked-as-func.js

@@ -0,0 +1,23 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-get-arraybuffer.prototype.maxbytelength
+description: Throws a TypeError exception when invoked as a function
+info: |
+  get ArrayBuffer.prototype.maxByteLength
+
+  1. Let O be the this value.
+  2. Perform ? RequireInternalSlot(O, [[ArrayBufferData]]).
+  [...]
+features: [resizable-arraybuffer]
+---*/
+
+var getter = Object.getOwnPropertyDescriptor(
+  ArrayBuffer.prototype, 'maxByteLength'
+).get;
+
+assert.sameValue(typeof getter, 'function');
+
+assert.throws(TypeError, function() {
+  getter();
+});

+ 13 - 13
Jint.Tests.Test262/test/built-ins/TypedArray/prototype/length/BigInt/length.js → Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/maxByteLength/length.js

@@ -1,12 +1,11 @@
-// Copyright (C) 2015 André Bargull. All rights reserved.
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
 // This code is governed by the BSD license found in the LICENSE file.
-
 /*---
-esid: sec-get-%typedarray%.prototype.length
+esid: sec-get-arraybuffer.prototype.maxbytelength
 description: >
-  get %TypedArray%.prototype.length.length is 0.
+  get ArrayBuffer.prototype.maxByteLength.length is 0.
 info: |
-  get %TypedArray%.prototype.length
+  get ArrayBuffer.prototype.maxByteLength
 
   17 ECMAScript Standard Built-in Objects:
     Every built-in Function object, including constructors, has a length
@@ -19,14 +18,15 @@ info: |
     Unless otherwise specified, the length property of a built-in Function
     object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
     [[Configurable]]: true }.
-includes: [propertyHelper.js, testBigIntTypedArray.js]
-features: [BigInt, TypedArray]
+includes: [propertyHelper.js]
+features: [resizable-arraybuffer]
 ---*/
 
-var desc = Object.getOwnPropertyDescriptor(TypedArray.prototype, "length");
-
-assert.sameValue(desc.get.length, 0);
+var desc = Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, 'maxByteLength');
 
-verifyNotEnumerable(desc.get, "length");
-verifyNotWritable(desc.get, "length");
-verifyConfigurable(desc.get, "length");
+verifyProperty(desc.get, 'length', {
+  value: 0,
+  enumerable: false,
+  writable: false,
+  configurable: true
+});

+ 24 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/maxByteLength/name.js

@@ -0,0 +1,24 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-get-arraybuffer.prototype.maxbytelength
+description: >
+  get ArrayBuffer.prototype.maxByteLength
+
+  17 ECMAScript Standard Built-in Objects
+
+  Functions that are specified as get or set accessor functions of built-in
+  properties have "get " or "set " prepended to the property name string.
+
+includes: [propertyHelper.js]
+features: [resizable-arraybuffer]
+---*/
+
+var desc = Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, 'maxByteLength');
+
+verifyProperty(desc.get, 'name', {
+  value: 'get maxByteLength',
+  enumerable: false,
+  writable: false,
+  configurable: true
+});

+ 25 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/maxByteLength/prop-desc.js

@@ -0,0 +1,25 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-get-arraybuffer.prototype.maxbytelength
+description: >
+  "maxByteLength" property of ArrayBuffer.prototype
+info: |
+  ArrayBuffer.prototype.maxByteLength is an accessor property whose set
+  accessor function is undefined.
+
+  Section 17: Every accessor property described in clauses 18 through 26 and in
+  Annex B.2 has the attributes {[[Enumerable]]: false, [[Configurable]]: true }
+includes: [propertyHelper.js]
+features: [resizable-arraybuffer]
+---*/
+
+var desc = Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, 'maxByteLength');
+
+assert.sameValue(desc.set, undefined);
+assert.sameValue(typeof desc.get, 'function');
+
+verifyProperty(ArrayBuffer.prototype, 'maxByteLength', {
+  enumerable: false,
+  configurable: true
+});

+ 25 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/maxByteLength/return-maxbytelength-non-resizable.js

@@ -0,0 +1,25 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-get-arraybuffer.prototype.maxbytelength
+description: Return value from [[ArrayBufferByteLength]] internal slot
+info: |
+  24.1.4.1 get ArrayBuffer.prototype.maxByteLength
+
+  1. Let O be the this value.
+  2. Perform ? RequireInternalSlot(O, [[ArrayBufferData]]).
+  3. If IsSharedArrayBuffer(O) is true, throw a TypeError exception.
+  4. If IsDetachedBuffer(O) is true, return +0𝔽.
+  5. If IsResizableArrayBuffer(O) is true, then
+     [...]
+  6. Else,
+     a. Let length be O.[[ArrayBufferByteLength]].
+  7. Return 𝔽(length).
+features: [resizable-arraybuffer]
+---*/
+
+var ab1 = new ArrayBuffer(0);
+assert.sameValue(ab1.maxByteLength, 0);
+
+var ab2 = new ArrayBuffer(42);
+assert.sameValue(ab2.maxByteLength, 42);

+ 28 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/maxByteLength/return-maxbytelength-resizable.js

@@ -0,0 +1,28 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-get-arraybuffer.prototype.maxbytelength
+description: Return value from [[ArrayBufferMaxByteLength]] internal slot
+info: |
+  24.1.4.1 get ArrayBuffer.prototype.maxByteLength
+
+  1. Let O be the this value.
+  2. Perform ? RequireInternalSlot(O, [[ArrayBufferData]]).
+  3. If IsSharedArrayBuffer(O) is true, throw a TypeError exception.
+  4. If IsDetachedBuffer(O) is true, return +0𝔽.
+  5. If IsResizableArrayBuffer(O) is true, then
+     a. Let length be O.[[ArrayBufferMaxByteLength]].
+  6. Else,
+     [...]
+  7. Return 𝔽(length).
+features: [resizable-arraybuffer]
+---*/
+
+var ab1 = new ArrayBuffer(0, { maxByteLength: 0 });
+assert.sameValue(ab1.maxByteLength, 0);
+
+var ab2 = new ArrayBuffer(0, { maxByteLength: 23 });
+assert.sameValue(ab2.maxByteLength, 23);
+
+var ab3 = new ArrayBuffer(42, { maxByteLength: 42 });
+assert.sameValue(ab3.maxByteLength, 42);

+ 39 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/maxByteLength/this-has-no-arraybufferdata-internal.js

@@ -0,0 +1,39 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-get-arraybuffer.prototype.maxbytelength
+description: >
+  Throws a TypeError exception when `this` does not have a [[ArrayBufferData]]
+  internal slot
+info: |
+  get ArrayBuffer.prototype.maxByteLength
+
+  1. Let O be the this value.
+  2. Perform ? RequireInternalSlot(O, [[ArrayBufferData]]).
+  [...]
+features: [DataView, Int8Array, resizable-arraybuffer]
+---*/
+
+var getter = Object.getOwnPropertyDescriptor(
+  ArrayBuffer.prototype, "maxByteLength"
+).get;
+
+assert.sameValue(typeof getter, "function");
+
+assert.throws(TypeError, function() {
+  getter.call({});
+});
+
+assert.throws(TypeError, function() {
+  getter.call([]);
+});
+
+var ta = new Int8Array(8);
+assert.throws(TypeError, function() {
+  getter.call(ta);
+});
+
+var dv = new DataView(new ArrayBuffer(8), 0);
+assert.throws(TypeError, function() {
+  getter.call(dv);
+});

+ 48 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/maxByteLength/this-is-not-object.js

@@ -0,0 +1,48 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-get-arraybuffer.prototype.maxbytelength
+description: Throws a TypeError exception when `this` is not Object
+info: |
+  get ArrayBuffer.prototype.maxByteLength
+
+  1. Let O be the this value.
+  2. Perform ? RequireInternalSlot(O, [[ArrayBufferData]]).
+  [...]
+features: [Symbol, resizable-arraybuffer]
+---*/
+
+var getter = Object.getOwnPropertyDescriptor(
+  ArrayBuffer.prototype, "maxByteLength"
+).get;
+
+assert.sameValue(typeof getter, "function");
+
+assert.throws(TypeError, function() {
+  getter.call(undefined);
+}, "this is undefined");
+
+assert.throws(TypeError, function() {
+  getter.call(null);
+}, "this is null");
+
+assert.throws(TypeError, function() {
+  getter.call(42);
+}, "this is 42");
+
+assert.throws(TypeError, function() {
+  getter.call("1");
+}, "this is a string");
+
+assert.throws(TypeError, function() {
+  getter.call(true);
+}, "this is true");
+
+assert.throws(TypeError, function() {
+  getter.call(false);
+}, "this is false");
+
+var s = Symbol("s");
+assert.throws(TypeError, function() {
+  getter.call(s);
+}, "this is a Symbol");

+ 33 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/maxByteLength/this-is-sharedarraybuffer.js

@@ -0,0 +1,33 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-get-arraybuffer.prototype.maxbytelength
+description: Throws a TypeError exception when `this` is a SharedArrayBuffer
+info: |
+  get ArrayBuffer.prototype.maxByteLength
+
+  1. Let O be the this value.
+  2. Perform ? RequireInternalSlot(O, [[ArrayBufferData]]).
+  3. If IsSharedArrayBuffer(O) is true, throw a TypeError exception.
+  [...]
+features: [SharedArrayBuffer, resizable-arraybuffer]
+---*/
+
+var maxByteLength = Object.getOwnPropertyDescriptor(
+  ArrayBuffer.prototype, "maxByteLength"
+);
+
+var getter = maxByteLength.get;
+var sab = new SharedArrayBuffer(4);
+
+assert.sameValue(typeof getter, "function");
+
+assert.throws(TypeError, function() {
+  getter.call(sab);
+}, "`this` cannot be a SharedArrayBuffer");
+
+Object.defineProperties(sab, { maxByteLength: maxByteLength });
+
+assert.throws(TypeError, function() {
+  sab.maxByteLength;
+}, "`this` cannot be a SharedArrayBuffer");

+ 34 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resizable/detached-buffer.js

@@ -0,0 +1,34 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-get-arraybuffer.prototype.resizable
+description: Unaffected by buffer's attachedness
+info: |
+  get ArrayBuffer.prototype.resizable
+
+  1. Let O be the this value.
+  2. Perform ? RequireInternalSlot(O, [[ArrayBufferData]]).
+  3. If IsSharedArrayBuffer(O) is true, throw a TypeError exception.
+  4. Return IsResizableArrayBuffer(O).
+
+  IsResizableArrayBuffer ( arrayBuffer )
+
+  1. Assert: Type(arrayBuffer) is Object and arrayBuffer has an
+     [[ArrayBufferData]] internal slot.
+  2. If buffer has an [[ArrayBufferMaxByteLength]] internal slot, return true.
+  3. Return false.
+includes: [detachArrayBuffer.js]
+features: [resizable-arraybuffer]
+---*/
+
+var ab1 = new ArrayBuffer(1);
+
+$DETACHBUFFER(ab1);
+
+assert.sameValue(ab1.resizable, false);
+
+var ab2 = new ArrayBuffer(1, {maxByteLength: 1});
+
+$DETACHBUFFER(ab2);
+
+assert.sameValue(ab2.resizable, true);

+ 17 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resizable/invoked-as-accessor.js

@@ -0,0 +1,17 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-get-arraybuffer.prototype.resizable
+description: Requires this value to have a [[ArrayBufferData]] internal slot
+info: |
+  get ArrayBuffer.prototype.resizable
+
+  1. Let O be the this value.
+  2. Perform ? RequireInternalSlot(O, [[ArrayBufferData]]).
+  [...]
+features: [resizable-arraybuffer]
+---*/
+
+assert.throws(TypeError, function() {
+  ArrayBuffer.prototype.resizable;
+});

+ 23 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resizable/invoked-as-func.js

@@ -0,0 +1,23 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-get-arraybuffer.prototype.resizable
+description: Throws a TypeError exception when invoked as a function
+info: |
+  get ArrayBuffer.prototype.resizable
+
+  1. Let O be the this value.
+  2. Perform ? RequireInternalSlot(O, [[ArrayBufferData]]).
+  [...]
+features: [resizable-arraybuffer]
+---*/
+
+var getter = Object.getOwnPropertyDescriptor(
+  ArrayBuffer.prototype, 'resizable'
+).get;
+
+assert.sameValue(typeof getter, 'function');
+
+assert.throws(TypeError, function() {
+  getter();
+});

+ 32 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resizable/length.js

@@ -0,0 +1,32 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-get-arraybuffer.prototype.resizable
+description: >
+  get ArrayBuffer.prototype.resizable.length is 0.
+info: |
+  get ArrayBuffer.prototype.resizeable
+
+  17 ECMAScript Standard Built-in Objects:
+    Every built-in Function object, including constructors, has a length
+    property whose value is an integer. Unless otherwise specified, this
+    value is equal to the largest number of named arguments shown in the
+    subclause headings for the function description, including optional
+    parameters. However, rest parameters shown using the form “...name”
+    are not included in the default argument count.
+
+    Unless otherwise specified, the length property of a built-in Function
+    object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
+    [[Configurable]]: true }.
+includes: [propertyHelper.js]
+features: [resizable-arraybuffer]
+---*/
+
+var desc = Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, 'resizable');
+
+verifyProperty(desc.get, 'length', {
+  value: 0,
+  enumerable: false,
+  writable: false,
+  configurable: true
+});

+ 24 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resizable/name.js

@@ -0,0 +1,24 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-get-arraybuffer.prototype.resizable
+description: >
+  get ArrayBuffer.prototype.resizable
+
+  17 ECMAScript Standard Built-in Objects
+
+  Functions that are specified as get or set accessor functions of built-in
+  properties have "get " or "set " prepended to the property name string.
+
+includes: [propertyHelper.js]
+features: [resizable-arraybuffer]
+---*/
+
+var desc = Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, 'resizable');
+
+verifyProperty(desc.get, 'name', {
+  value: 'get resizable',
+  enumerable: false,
+  writable: false,
+  configurable: true
+});

+ 25 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resizable/prop-desc.js

@@ -0,0 +1,25 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-get-arraybuffer.prototype.resizable
+description: >
+  "resizable" property of ArrayBuffer.prototype
+info: |
+  ArrayBuffer.prototype.resizable is an accessor property whose set accessor
+  function is undefined.
+
+  Section 17: Every accessor property described in clauses 18 through 26 and in
+  Annex B.2 has the attributes {[[Enumerable]]: false, [[Configurable]]: true }
+includes: [propertyHelper.js]
+features: [resizable-arraybuffer]
+---*/
+
+var desc = Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, 'resizable');
+
+assert.sameValue(desc.set, undefined);
+assert.sameValue(typeof desc.get, 'function');
+
+verifyProperty(ArrayBuffer.prototype, 'resizable', {
+  enumerable: false,
+  configurable: true
+});

+ 29 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resizable/return-resizable.js

@@ -0,0 +1,29 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-get-arraybuffer.prototype.resizable
+description: Return value according to [[ArrayBufferMaxByteLength]] internal slot
+info: |
+  get ArrayBuffer.prototype.resizable
+
+  1. Let O be the this value.
+  2. Perform ? RequireInternalSlot(O, [[ArrayBufferData]]).
+  3. If IsSharedArrayBuffer(O) is true, throw a TypeError exception.
+  4. Return IsResizableArrayBuffer(O).
+
+  IsResizableArrayBuffer ( arrayBuffer )
+
+  1. Assert: Type(arrayBuffer) is Object and arrayBuffer has an
+     [[ArrayBufferData]] internal slot.
+  2. If buffer has an [[ArrayBufferMaxByteLength]] internal slot, return true.
+  3. Return false.
+features: [resizable-arraybuffer]
+---*/
+
+var ab1 = new ArrayBuffer(1);
+
+assert.sameValue(ab1.resizable, false);
+
+var ab2 = new ArrayBuffer(1, {maxByteLength: 1});
+
+assert.sameValue(ab2.resizable, true);

+ 39 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resizable/this-has-no-arraybufferdata-internal.js

@@ -0,0 +1,39 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-get-arraybuffer.prototype.resizable
+description: >
+  Throws a TypeError exception when `this` does not have a [[ArrayBufferData]]
+  internal slot
+info: |
+  get ArrayBuffer.prototype.resizable
+
+  1. Let O be the this value.
+  2. Perform ? RequireInternalSlot(O, [[ArrayBufferData]]).
+  [...]
+features: [DataView, Int8Array, resizable-arraybuffer]
+---*/
+
+var getter = Object.getOwnPropertyDescriptor(
+  ArrayBuffer.prototype, "resizable"
+).get;
+
+assert.sameValue(typeof getter, "function");
+
+assert.throws(TypeError, function() {
+  getter.call({});
+});
+
+assert.throws(TypeError, function() {
+  getter.call([]);
+});
+
+var ta = new Int8Array(8);
+assert.throws(TypeError, function() {
+  getter.call(ta);
+});
+
+var dv = new DataView(new ArrayBuffer(8), 0);
+assert.throws(TypeError, function() {
+  getter.call(dv);
+});

+ 15 - 16
Jint.Tests.Test262/test/built-ins/TypedArray/prototype/length/BigInt/this-is-not-object.js → Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resizable/this-is-not-object.js

@@ -1,49 +1,48 @@
-// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
 // This code is governed by the BSD license found in the LICENSE file.
 /*---
-esid: sec-get-%typedarray%.prototype.length
+esid: sec-get-arraybuffer.prototype.resizable
 description: Throws a TypeError exception when `this` is not Object
 info: |
-  22.2.3.18 get %TypedArray%.prototype.length
+  get ArrayBuffer.prototype.resizable
 
   1. Let O be the this value.
-  2. If Type(O) is not Object, throw a TypeError exception.
-  ...
-includes: [testBigIntTypedArray.js]
-features: [BigInt, Symbol, TypedArray]
+  2. Perform ? RequireInternalSlot(O, [[ArrayBufferData]]).
+  [...]
+features: [Symbol, resizable-arraybuffer]
 ---*/
 
-var TypedArrayPrototype = TypedArray.prototype;
 var getter = Object.getOwnPropertyDescriptor(
-  TypedArrayPrototype, "length"
+  ArrayBuffer.prototype, "resizable"
 ).get;
 
+assert.sameValue(typeof getter, "function");
 
 assert.throws(TypeError, function() {
   getter.call(undefined);
-}, "undefined");
+}, "this is undefined");
 
 assert.throws(TypeError, function() {
   getter.call(null);
-}, "null");
+}, "this is null");
 
 assert.throws(TypeError, function() {
   getter.call(42);
-}, "number");
+}, "this is 42");
 
 assert.throws(TypeError, function() {
   getter.call("1");
-}, "string");
+}, "this is a string");
 
 assert.throws(TypeError, function() {
   getter.call(true);
-}, "true");
+}, "this is true");
 
 assert.throws(TypeError, function() {
   getter.call(false);
-}, "false");
+}, "this is false");
 
 var s = Symbol("s");
 assert.throws(TypeError, function() {
   getter.call(s);
-}, "symbol");
+}, "this is a Symbol");

+ 33 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resizable/this-is-sharedarraybuffer.js

@@ -0,0 +1,33 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-get-arraybuffer.prototype.resizable
+description: Throws a TypeError exception when `this` is a SharedArrayBuffer
+info: |
+  get ArrayBuffer.prototype.resizable
+
+  1. Let O be the this value.
+  2. Perform ? RequireInternalSlot(O, [[ArrayBufferData]]).
+  3. If IsSharedArrayBuffer(O) is true, throw a TypeError exception.
+  [...]
+features: [SharedArrayBuffer, resizable-arraybuffer]
+---*/
+
+var resizable = Object.getOwnPropertyDescriptor(
+  ArrayBuffer.prototype, "resizable"
+);
+
+var getter = resizable.get;
+var sab = new SharedArrayBuffer(4);
+
+assert.sameValue(typeof getter, "function");
+
+assert.throws(TypeError, function() {
+  getter.call(sab);
+}, "`this` cannot be a SharedArrayBuffer");
+
+Object.defineProperties(sab, { resizable: resizable });
+
+assert.throws(TypeError, function() {
+  sab.resizable;
+}, "`this` cannot be a SharedArrayBuffer");

+ 22 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/descriptor.js

@@ -0,0 +1,22 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-arraybuffer.prototype.resize
+description: >
+  ArrayBuffer.prototype.resize has default data property attributes.
+info: |
+  ArrayBuffer.prototype.resize ( newLength )
+
+  17 ECMAScript Standard Built-in Objects:
+    Every other data property described in clauses 18 through 26 and in
+    Annex B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false,
+    [[Configurable]]: true } unless otherwise specified.
+includes: [propertyHelper.js]
+features: [resizable-arraybuffer]
+---*/
+
+verifyProperty(ArrayBuffer.prototype, 'resize', {
+  enumerable: false,
+  writable: true,
+  configurable: true
+});

+ 15 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/extensible.js

@@ -0,0 +1,15 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-arraybuffer.prototype.resize
+description: ArrayBuffer.prototype.resize is extensible.
+info: |
+  ArrayBuffer.prototype.resize ( newLength )
+
+  17 ECMAScript Standard Built-in Objects:
+    Unless specified otherwise, the [[Extensible]] internal slot
+    of a built-in object initially has the value true.
+features: [resizable-arraybuffer]
+---*/
+
+assert(Object.isExtensible(ArrayBuffer.prototype.resize));

+ 30 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/length.js

@@ -0,0 +1,30 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-arraybuffer.prototype.resize
+description: >
+  ArrayBuffer.prototype.resize.length is 1.
+info: |
+  ArrayBuffer.prototype.resize ( newLength )
+
+  17 ECMAScript Standard Built-in Objects:
+    Every built-in Function object, including constructors, has a length
+    property whose value is an integer. Unless otherwise specified, this
+    value is equal to the largest number of named arguments shown in the
+    subclause headings for the function description, including optional
+    parameters. However, rest parameters shown using the form “...name”
+    are not included in the default argument count.
+
+    Unless otherwise specified, the length property of a built-in Function
+    object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
+    [[Configurable]]: true }.
+includes: [propertyHelper.js]
+features: [resizable-arraybuffer]
+---*/
+
+verifyProperty(ArrayBuffer.prototype.resize, 'length', {
+  value: 1,
+  enumerable: false,
+  writable: false,
+  configurable: true
+});

+ 27 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/name.js

@@ -0,0 +1,27 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-arraybuffer.prototype.resize
+description: >
+  ArrayBuffer.prototype.resize.name is "resize".
+info: |
+  ArrayBuffer.prototype.resize ( newLength )
+
+  17 ECMAScript Standard Built-in Objects:
+    Every built-in Function object, including constructors, that is not
+    identified as an anonymous function has a name property whose value
+    is a String.
+
+    Unless otherwise specified, the name property of a built-in Function
+    object, if it exists, has the attributes { [[Writable]]: false,
+    [[Enumerable]]: false, [[Configurable]]: true }.
+features: [resizable-arraybuffer]
+includes: [propertyHelper.js]
+---*/
+
+verifyProperty(ArrayBuffer.prototype.resize, 'name', {
+  value: 'resize',
+  enumerable: false,
+  wrtiable: false,
+  configurable: true
+});

+ 25 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/new-length-excessive.js

@@ -0,0 +1,25 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-arraybuffer.prototype.resize
+description: >
+  Throws a RangeError the newLength value is larger than the max byte length
+info: |
+  ArrayBuffer.prototype.resize ( newLength )
+
+  1. Let O be the this value.
+  2. Perform ? RequireInternalSlot(O, [[ArrayBufferMaxByteLength]]).
+  3. If IsSharedArrayBuffer(O) is true, throw a TypeError exception.
+  4. If IsDetachedBuffer(O) is true, throw a TypeError exception.
+  5. Let newByteLength be ? ToIntegerOrInfinity(newLength).
+  6. If newByteLength < 0 or newByteLength > O.[[ArrayBufferMaxByteLength]],
+     throw a RangeError exception.
+  [...]
+features: [resizable-arraybuffer]
+---*/
+
+var ab = new ArrayBuffer(4, {maxByteLength: 4});
+
+assert.throws(RangeError, function() {
+  ab.resize(5);
+});

+ 25 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/new-length-negative.js

@@ -0,0 +1,25 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-arraybuffer.prototype.resize
+description: >
+  Throws a RangeError the newLength value is less than zero
+info: |
+  ArrayBuffer.prototype.resize ( newLength )
+
+  1. Let O be the this value.
+  2. Perform ? RequireInternalSlot(O, [[ArrayBufferMaxByteLength]]).
+  3. If IsSharedArrayBuffer(O) is true, throw a TypeError exception.
+  4. If IsDetachedBuffer(O) is true, throw a TypeError exception.
+  5. Let newByteLength be ? ToIntegerOrInfinity(newLength).
+  6. If newByteLength < 0 or newByteLength > O.[[ArrayBufferMaxByteLength]],
+     throw a RangeError exception.
+  [...]
+features: [resizable-arraybuffer]
+---*/
+
+var ab = new ArrayBuffer(4, {maxByteLength: 4});
+
+assert.throws(RangeError, function() {
+  ab.resize(-1);
+});

+ 37 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/new-length-non-number.js

@@ -0,0 +1,37 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-arraybuffer.prototype.resize
+description: Throws a TypeError if provided length cannot be coerced to a number
+info: |
+  ArrayBuffer.prototype.resize ( newLength )
+
+  1. Let O be the this value.
+  2. Perform ? RequireInternalSlot(O, [[ArrayBufferMaxByteLength]]).
+  3. If IsSharedArrayBuffer(O) is true, throw a TypeError exception.
+  4. If IsDetachedBuffer(O) is true, throw a TypeError exception.
+  5. Let newByteLength be ? ToIntegerOrInfinity(newLength).
+  [...]
+features: [resizable-arraybuffer]
+---*/
+
+var log = [];
+var newLength = {
+  toString: function() {
+    log.push('toString');
+    return {};
+  },
+  valueOf: function() {
+    log.push('valueOf');
+    return {};
+  }
+};
+var ab = new ArrayBuffer(0, {maxByteLength: 4});
+
+assert.throws(TypeError, function() {
+  ab.resize(newLength);
+});
+
+assert.sameValue(log.length, 2);
+assert.sameValue(log[0], 'valueOf');
+assert.sameValue(log[1], 'toString');

+ 25 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/nonconstructor.js

@@ -0,0 +1,25 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-arraybuffer.prototype.resize
+description: >
+  ArrayBuffer.prototype.resize is not a constructor function.
+info: |
+  ArrayBuffer.prototype.resize ( newLength )
+
+  17 ECMAScript Standard Built-in Objects:
+    Built-in function objects that are not identified as constructors do not
+    implement the [[Construct]] internal method unless otherwise specified
+    in the description of a particular function.
+features: [resizable-arraybuffer]
+---*/
+
+assert.sameValue(
+  Object.prototype.hasOwnProperty.call(ArrayBuffer.prototype.resize, 'prototype'),
+  false
+);
+
+var arrayBuffer = new ArrayBuffer(8);
+assert.throws(TypeError, function() {
+  new arrayBuffer.resize();
+});

+ 77 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/resize-grow.js

@@ -0,0 +1,77 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-arraybuffer.prototype.resize
+description: Behavior when attempting to grow a resizable array buffer
+info: |
+  ArrayBuffer.prototype.resize ( newLength )
+
+  1. Let O be the this value.
+  2. Perform ? RequireInternalSlot(O, [[ArrayBufferMaxByteLength]]).
+  3. If IsSharedArrayBuffer(O) is true, throw a TypeError exception.
+  4. If IsDetachedBuffer(O) is true, throw a TypeError exception.
+  5. Let newByteLength be ? ToIntegerOrInfinity(newLength).
+  6. If newByteLength < 0 or newByteLength > O.[[ArrayBufferMaxByteLength]],
+     throw a RangeError exception.
+  7. Let hostHandled be ? HostResizeArrayBuffer(O, newByteLength).
+  [...]
+
+  HostResizeArrayBuffer ( buffer, newByteLength )
+
+  The implementation of HostResizeArrayBuffer must conform to the following
+  requirements:
+
+  - The abstract operation does not detach buffer.
+  - The abstract operation may complete normally or abruptly.
+  - If the abstract operation completes normally with handled,
+    buffer.[[ArrayBufferByteLength]] is newByteLength.
+  - The return value is either handled or unhandled.
+features: [resizable-arraybuffer]
+---*/
+
+var ab = new ArrayBuffer(4, {maxByteLength: 5});
+var caught = false;
+var result;
+
+// If the host chooses to throw as allowed by the specification, the observed
+// behavior will be identical to the case where `ArrayBuffer.prototype.resize`
+// has not been implemented. The following assertion prevents this test from
+// passing in runtimes which have not implemented the method.
+assert.sameValue(typeof ab.resize, 'function');
+
+try {
+  result = ab.resize(5);
+} catch (_) {
+  caught = true;
+}
+
+try {
+  ab.slice();
+} catch (_) {
+  throw new Test262Error('The ArrayBuffer under test was detached');
+}
+
+// One of the following three conditions must be met:
+//
+// - HostResizeArrayBuffer returns an abrupt completion
+// - HostResizeArrayBuffer handles the resize operation and conforms to the
+//   invarient regarding [[ArrayBufferByteLength]]
+// - HostResizeArrayBuffer does not handle the resize operation, and the
+//   `resize` method updates [[ArrayBufferByteLength]]
+//
+// The final two conditions are indistinguishable.
+assert(caught || ab.byteLength === 5, 'byteLength');
+
+// One of the following three conditions must be met:
+//
+// - HostResizeArrayBuffer returns an abrupt completion
+// - HostResizeArrayBuffer handles the resize operation, and the `resize`
+//   method returns early
+// - HostResizeArrayBuffer does not handle the resize operation, and the
+//   `resize` method executes its final steps
+//
+// All three conditions have the same effect on the value of `result`.
+assert.sameValue(result, undefined, 'normal completion value');
+
+// The contents of the ArrayBuffer are not guaranteed by the host-defined
+// abstract operation, so they are not asserted in this test.

+ 78 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/resize-same-size-zero-explicit.js

@@ -0,0 +1,78 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-arraybuffer.prototype.resize
+description: >
+  Behavior when attempting to reset the size of a resizable array buffer to zero explicitly
+info: |
+  ArrayBuffer.prototype.resize ( newLength )
+
+  1. Let O be the this value.
+  2. Perform ? RequireInternalSlot(O, [[ArrayBufferMaxByteLength]]).
+  3. If IsSharedArrayBuffer(O) is true, throw a TypeError exception.
+  4. If IsDetachedBuffer(O) is true, throw a TypeError exception.
+  5. Let newByteLength be ? ToIntegerOrInfinity(newLength).
+  6. If newByteLength < 0 or newByteLength > O.[[ArrayBufferMaxByteLength]],
+     throw a RangeError exception.
+  7. Let hostHandled be ? HostResizeArrayBuffer(O, newByteLength).
+  [...]
+
+  HostResizeArrayBuffer ( buffer, newByteLength )
+
+  The implementation of HostResizeArrayBuffer must conform to the following
+  requirements:
+
+  - The abstract operation does not detach buffer.
+  - The abstract operation may complete normally or abruptly.
+  - If the abstract operation completes normally with handled,
+    buffer.[[ArrayBufferByteLength]] is newByteLength.
+  - The return value is either handled or unhandled.
+features: [resizable-arraybuffer]
+---*/
+
+var ab = new ArrayBuffer(0, {maxByteLength: 0});
+var caught = false;
+var result;
+
+// If the host chooses to throw as allowed by the specification, the observed
+// behavior will be identical to the case where `ArrayBuffer.prototype.resize`
+// has not been implemented. The following assertion prevents this test from
+// passing in runtimes which have not implemented the method.
+assert.sameValue(typeof ab.resize, 'function');
+
+try {
+  result = ab.resize(0);
+} catch (_) {
+  caught = true;
+}
+
+try {
+  ab.slice();
+} catch (_) {
+  throw new Test262Error('The ArrayBuffer under test was detached');
+}
+
+// One of the following three conditions must be met:
+//
+// - HostResizeArrayBuffer returns an abrupt completion
+// - HostResizeArrayBuffer handles the resize operation and conforms to the
+//   invarient regarding [[ArrayBufferByteLength]]
+// - HostResizeArrayBuffer does not handle the resize operation, and the
+//   `resize` method updates [[ArrayBufferByteLength]]
+//
+// The final two conditions are indistinguishable.
+assert(caught || ab.byteLength === 0, 'byteLength');
+
+// One of the following three conditions must be met:
+//
+// - HostResizeArrayBuffer returns an abrupt completion
+// - HostResizeArrayBuffer handles the resize operation, and the `resize`
+//   method returns early
+// - HostResizeArrayBuffer does not handle the resize operation, and the
+//   `resize` method executes its final steps
+//
+// All three conditions have the same effect on the value of `result`.
+assert.sameValue(result, undefined, 'normal completion value');
+
+// The contents of the ArrayBuffer are not guaranteed by the host-defined
+// abstract operation, so they are not asserted in this test.

+ 78 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/resize-same-size-zero-implicit.js

@@ -0,0 +1,78 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-arraybuffer.prototype.resize
+description: >
+  Behavior when attempting to reset the size of a resizable array buffer to zero explicitly
+info: |
+  ArrayBuffer.prototype.resize ( newLength )
+
+  1. Let O be the this value.
+  2. Perform ? RequireInternalSlot(O, [[ArrayBufferMaxByteLength]]).
+  3. If IsSharedArrayBuffer(O) is true, throw a TypeError exception.
+  4. If IsDetachedBuffer(O) is true, throw a TypeError exception.
+  5. Let newByteLength be ? ToIntegerOrInfinity(newLength).
+  6. If newByteLength < 0 or newByteLength > O.[[ArrayBufferMaxByteLength]],
+     throw a RangeError exception.
+  7. Let hostHandled be ? HostResizeArrayBuffer(O, newByteLength).
+  [...]
+
+  HostResizeArrayBuffer ( buffer, newByteLength )
+
+  The implementation of HostResizeArrayBuffer must conform to the following
+  requirements:
+
+  - The abstract operation does not detach buffer.
+  - The abstract operation may complete normally or abruptly.
+  - If the abstract operation completes normally with handled,
+    buffer.[[ArrayBufferByteLength]] is newByteLength.
+  - The return value is either handled or unhandled.
+features: [resizable-arraybuffer]
+---*/
+
+var ab = new ArrayBuffer(0, {maxByteLength: 0});
+var caught = false;
+var result;
+
+// If the host chooses to throw as allowed by the specification, the observed
+// behavior will be identical to the case where `ArrayBuffer.prototype.resize`
+// has not been implemented. The following assertion prevents this test from
+// passing in runtimes which have not implemented the method.
+assert.sameValue(typeof ab.resize, 'function');
+
+try {
+  result = ab.resize();
+} catch (_) {
+  caught = true;
+}
+
+try {
+  ab.slice();
+} catch (_) {
+  throw new Test262Error('The ArrayBuffer under test was detached');
+}
+
+// One of the following three conditions must be met:
+//
+// - HostResizeArrayBuffer returns an abrupt completion
+// - HostResizeArrayBuffer handles the resize operation and conforms to the
+//   invarient regarding [[ArrayBufferByteLength]]
+// - HostResizeArrayBuffer does not handle the resize operation, and the
+//   `resize` method updates [[ArrayBufferByteLength]]
+//
+// The final two conditions are indistinguishable.
+assert(caught || ab.byteLength === 0, 'byteLength');
+
+// One of the following three conditions must be met:
+//
+// - HostResizeArrayBuffer returns an abrupt completion
+// - HostResizeArrayBuffer handles the resize operation, and the `resize`
+//   method returns early
+// - HostResizeArrayBuffer does not handle the resize operation, and the
+//   `resize` method executes its final steps
+//
+// All three conditions have the same effect on the value of `result`.
+assert.sameValue(result, undefined, 'normal completion value');
+
+// The contents of the ArrayBuffer are not guaranteed by the host-defined
+// abstract operation, so they are not asserted in this test.

+ 78 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/resize-same-size.js

@@ -0,0 +1,78 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-arraybuffer.prototype.resize
+description: >
+  Behavior when attempting to reset the size of a resizable array buffer
+info: |
+  ArrayBuffer.prototype.resize ( newLength )
+
+  1. Let O be the this value.
+  2. Perform ? RequireInternalSlot(O, [[ArrayBufferMaxByteLength]]).
+  3. If IsSharedArrayBuffer(O) is true, throw a TypeError exception.
+  4. If IsDetachedBuffer(O) is true, throw a TypeError exception.
+  5. Let newByteLength be ? ToIntegerOrInfinity(newLength).
+  6. If newByteLength < 0 or newByteLength > O.[[ArrayBufferMaxByteLength]],
+     throw a RangeError exception.
+  7. Let hostHandled be ? HostResizeArrayBuffer(O, newByteLength).
+  [...]
+
+  HostResizeArrayBuffer ( buffer, newByteLength )
+
+  The implementation of HostResizeArrayBuffer must conform to the following
+  requirements:
+
+  - The abstract operation does not detach buffer.
+  - The abstract operation may complete normally or abruptly.
+  - If the abstract operation completes normally with handled,
+    buffer.[[ArrayBufferByteLength]] is newByteLength.
+  - The return value is either handled or unhandled.
+features: [resizable-arraybuffer]
+---*/
+
+var ab = new ArrayBuffer(4, {maxByteLength: 4});
+var caught = false;
+var result;
+
+// If the host chooses to throw as allowed by the specification, the observed
+// behavior will be identical to the case where `ArrayBuffer.prototype.resize`
+// has not been implemented. The following assertion prevents this test from
+// passing in runtimes which have not implemented the method.
+assert.sameValue(typeof ab.resize, 'function');
+
+try {
+  result = ab.resize(4);
+} catch (_) {
+  caught = true;
+}
+
+try {
+  ab.slice();
+} catch (_) {
+  throw new Test262Error('The ArrayBuffer under test was detached');
+}
+
+// One of the following three conditions must be met:
+//
+// - HostResizeArrayBuffer returns an abrupt completion
+// - HostResizeArrayBuffer handles the resize operation and conforms to the
+//   invarient regarding [[ArrayBufferByteLength]]
+// - HostResizeArrayBuffer does not handle the resize operation, and the
+//   `resize` method updates [[ArrayBufferByteLength]]
+//
+// The final two conditions are indistinguishable.
+assert(caught || ab.byteLength === 4, 'byteLength');
+
+// One of the following three conditions must be met:
+//
+// - HostResizeArrayBuffer returns an abrupt completion
+// - HostResizeArrayBuffer handles the resize operation, and the `resize`
+//   method returns early
+// - HostResizeArrayBuffer does not handle the resize operation, and the
+//   `resize` method executes its final steps
+//
+// All three conditions have the same effect on the value of `result`.
+assert.sameValue(result, undefined, 'normal completion value');
+
+// The contents of the ArrayBuffer are not guaranteed by the host-defined
+// abstract operation, so they are not asserted in this test.

+ 77 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/resize-shrink-zero-explicit.js

@@ -0,0 +1,77 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-arraybuffer.prototype.resize
+description: Behavior when attempting to shrink a resizable array buffer to zero explicitly
+info: |
+  ArrayBuffer.prototype.resize ( newLength )
+
+  1. Let O be the this value.
+  2. Perform ? RequireInternalSlot(O, [[ArrayBufferMaxByteLength]]).
+  3. If IsSharedArrayBuffer(O) is true, throw a TypeError exception.
+  4. If IsDetachedBuffer(O) is true, throw a TypeError exception.
+  5. Let newByteLength be ? ToIntegerOrInfinity(newLength).
+  6. If newByteLength < 0 or newByteLength > O.[[ArrayBufferMaxByteLength]],
+     throw a RangeError exception.
+  7. Let hostHandled be ? HostResizeArrayBuffer(O, newByteLength).
+  [...]
+
+  HostResizeArrayBuffer ( buffer, newByteLength )
+
+  The implementation of HostResizeArrayBuffer must conform to the following
+  requirements:
+
+  - The abstract operation does not detach buffer.
+  - The abstract operation may complete normally or abruptly.
+  - If the abstract operation completes normally with handled,
+    buffer.[[ArrayBufferByteLength]] is newByteLength.
+  - The return value is either handled or unhandled.
+features: [resizable-arraybuffer]
+---*/
+
+var ab = new ArrayBuffer(4, {maxByteLength: 4});
+var caught = false;
+var result;
+
+// If the host chooses to throw as allowed by the specification, the observed
+// behavior will be identical to the case where `ArrayBuffer.prototype.resize`
+// has not been implemented. The following assertion prevents this test from
+// passing in runtimes which have not implemented the method.
+assert.sameValue(typeof ab.resize, 'function');
+
+try {
+  result = ab.resize(0);
+} catch (_) {
+  caught = true;
+}
+
+try {
+  ab.slice();
+} catch (_) {
+  throw new Test262Error('The ArrayBuffer under test was detached');
+}
+
+// One of the following three conditions must be met:
+//
+// - HostResizeArrayBuffer returns an abrupt completion
+// - HostResizeArrayBuffer handles the resize operation and conforms to the
+//   invarient regarding [[ArrayBufferByteLength]]
+// - HostResizeArrayBuffer does not handle the resize operation, and the
+//   `resize` method updates [[ArrayBufferByteLength]]
+//
+// The final two conditions are indistinguishable.
+assert(caught || ab.byteLength === 0, 'byteLength');
+
+// One of the following three conditions must be met:
+//
+// - HostResizeArrayBuffer returns an abrupt completion
+// - HostResizeArrayBuffer handles the resize operation, and the `resize`
+//   method returns early
+// - HostResizeArrayBuffer does not handle the resize operation, and the
+//   `resize` method executes its final steps
+//
+// All three conditions have the same effect on the value of `result`.
+assert.sameValue(result, undefined, 'normal completion value');
+
+// The contents of the ArrayBuffer are not guaranteed by the host-defined
+// abstract operation, so they are not asserted in this test.

+ 77 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/resize-shrink-zero-implicit.js

@@ -0,0 +1,77 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-arraybuffer.prototype.resize
+description: Behavior when attempting to shrink a resizable array buffer to zero implicitly
+info: |
+  ArrayBuffer.prototype.resize ( newLength )
+
+  1. Let O be the this value.
+  2. Perform ? RequireInternalSlot(O, [[ArrayBufferMaxByteLength]]).
+  3. If IsSharedArrayBuffer(O) is true, throw a TypeError exception.
+  4. If IsDetachedBuffer(O) is true, throw a TypeError exception.
+  5. Let newByteLength be ? ToIntegerOrInfinity(newLength).
+  6. If newByteLength < 0 or newByteLength > O.[[ArrayBufferMaxByteLength]],
+     throw a RangeError exception.
+  7. Let hostHandled be ? HostResizeArrayBuffer(O, newByteLength).
+  [...]
+
+  HostResizeArrayBuffer ( buffer, newByteLength )
+
+  The implementation of HostResizeArrayBuffer must conform to the following
+  requirements:
+
+  - The abstract operation does not detach buffer.
+  - The abstract operation may complete normally or abruptly.
+  - If the abstract operation completes normally with handled,
+    buffer.[[ArrayBufferByteLength]] is newByteLength.
+  - The return value is either handled or unhandled.
+features: [resizable-arraybuffer]
+---*/
+
+var ab = new ArrayBuffer(4, {maxByteLength: 4});
+var caught = false;
+var result;
+
+// If the host chooses to throw as allowed by the specification, the observed
+// behavior will be identical to the case where `ArrayBuffer.prototype.resize`
+// has not been implemented. The following assertion prevents this test from
+// passing in runtimes which have not implemented the method.
+assert.sameValue(typeof ab.resize, 'function');
+
+try {
+  result = ab.resize();
+} catch (_) {
+  caught = true;
+}
+
+try {
+  ab.slice();
+} catch (_) {
+  throw new Test262Error('The ArrayBuffer under test was detached');
+}
+
+// One of the following three conditions must be met:
+//
+// - HostResizeArrayBuffer returns an abrupt completion
+// - HostResizeArrayBuffer handles the resize operation and conforms to the
+//   invarient regarding [[ArrayBufferByteLength]]
+// - HostResizeArrayBuffer does not handle the resize operation, and the
+//   `resize` method updates [[ArrayBufferByteLength]]
+//
+// The final two conditions are indistinguishable.
+assert(caught || ab.byteLength === 0, 'byteLength');
+
+// One of the following three conditions must be met:
+//
+// - HostResizeArrayBuffer returns an abrupt completion
+// - HostResizeArrayBuffer handles the resize operation, and the `resize`
+//   method returns early
+// - HostResizeArrayBuffer does not handle the resize operation, and the
+//   `resize` method executes its final steps
+//
+// All three conditions have the same effect on the value of `result`.
+assert.sameValue(result, undefined, 'normal completion value');
+
+// The contents of the ArrayBuffer are not guaranteed by the host-defined
+// abstract operation, so they are not asserted in this test.

+ 77 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/resize-shrink.js

@@ -0,0 +1,77 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-arraybuffer.prototype.resize
+description: Behavior when attempting to shrink a resizable array buffer
+info: |
+  ArrayBuffer.prototype.resize ( newLength )
+
+  1. Let O be the this value.
+  2. Perform ? RequireInternalSlot(O, [[ArrayBufferMaxByteLength]]).
+  3. If IsSharedArrayBuffer(O) is true, throw a TypeError exception.
+  4. If IsDetachedBuffer(O) is true, throw a TypeError exception.
+  5. Let newByteLength be ? ToIntegerOrInfinity(newLength).
+  6. If newByteLength < 0 or newByteLength > O.[[ArrayBufferMaxByteLength]],
+     throw a RangeError exception.
+  7. Let hostHandled be ? HostResizeArrayBuffer(O, newByteLength).
+  [...]
+
+  HostResizeArrayBuffer ( buffer, newByteLength )
+
+  The implementation of HostResizeArrayBuffer must conform to the following
+  requirements:
+
+  - The abstract operation does not detach buffer.
+  - The abstract operation may complete normally or abruptly.
+  - If the abstract operation completes normally with handled,
+    buffer.[[ArrayBufferByteLength]] is newByteLength.
+  - The return value is either handled or unhandled.
+features: [resizable-arraybuffer]
+---*/
+
+var ab = new ArrayBuffer(4, {maxByteLength: 4});
+var caught = false;
+var result;
+
+// If the host chooses to throw as allowed by the specification, the observed
+// behavior will be identical to the case where `ArrayBuffer.prototype.resize`
+// has not been implemented. The following assertion prevents this test from
+// passing in runtimes which have not implemented the method.
+assert.sameValue(typeof ab.resize, 'function');
+
+try {
+  result = ab.resize(3);
+} catch (_) {
+  caught = true;
+}
+
+try {
+  ab.slice();
+} catch (_) {
+  throw new Test262Error('The ArrayBuffer under test was detached');
+}
+
+// One of the following three conditions must be met:
+//
+// - HostResizeArrayBuffer returns an abrupt completion
+// - HostResizeArrayBuffer handles the resize operation and conforms to the
+//   invarient regarding [[ArrayBufferByteLength]]
+// - HostResizeArrayBuffer does not handle the resize operation, and the
+//   `resize` method updates [[ArrayBufferByteLength]]
+//
+// The final two conditions are indistinguishable.
+assert(caught || ab.byteLength === 3, 'byteLength');
+
+// One of the following three conditions must be met:
+//
+// - HostResizeArrayBuffer returns an abrupt completion
+// - HostResizeArrayBuffer handles the resize operation, and the `resize`
+//   method returns early
+// - HostResizeArrayBuffer does not handle the resize operation, and the
+//   `resize` method executes its final steps
+//
+// All three conditions have the same effect on the value of `result`.
+assert.sameValue(result, undefined, 'normal completion value');
+
+// The contents of the ArrayBuffer are not guaranteed by the host-defined
+// abstract operation, so they are not asserted in this test.

+ 27 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/this-is-detached.js

@@ -0,0 +1,27 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-arraybuffer.prototype.resize
+description: >
+  Throws a TypeError if `this` does not have an [[ArrayBufferData]] internal slot.
+info: |
+  ArrayBuffer.prototype.resize ( newLength )
+
+  1. Let O be the this value.
+  2. Perform ? RequireInternalSlot(O, [[ArrayBufferMaxByteLength]]).
+  3. If IsSharedArrayBuffer(O) is true, throw a TypeError exception.
+  4. If IsDetachedBuffer(O) is true, throw a TypeError exception.
+  [...]
+includes: [detachArrayBuffer.js]
+features: [resizable-arraybuffer]
+---*/
+
+assert.sameValue(typeof ArrayBuffer.prototype.resize, 'function');
+
+var ab = new ArrayBuffer(1);
+
+$DETACHBUFFER(ab);
+
+assert.throws(TypeError, function() {
+  ab.resize();
+});

+ 28 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/this-is-not-arraybuffer-object.js

@@ -0,0 +1,28 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-arraybuffer.prototype.resize
+description: >
+  Throws a TypeError if `this` does not have an [[ArrayBufferData]] internal slot.
+info: |
+  ArrayBuffer.prototype.resize ( newLength )
+
+  1. Let O be the this value.
+  2. Perform ? RequireInternalSlot(O, [[ArrayBufferMaxByteLength]]).
+  [...]
+features: [resizable-arraybuffer]
+---*/
+
+assert.sameValue(typeof ArrayBuffer.prototype.resize, 'function');
+
+assert.throws(TypeError, function() {
+  ArrayBuffer.prototype.resize();
+}, '`this` value is the ArrayBuffer prototype');
+
+assert.throws(TypeError, function() {
+  ArrayBuffer.prototype.resize.call({});
+}, '`this` value is an object');
+
+assert.throws(TypeError, function() {
+  ArrayBuffer.prototype.resize.call([]);
+}, '`this` value is an array');

+ 44 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/this-is-not-object.js

@@ -0,0 +1,44 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-arraybuffer.prototype.resize
+description: Throws a TypeError if `this` valueis not an object.
+info: |
+  ArrayBuffer.prototype.resize ( newLength )
+
+  1. Let O be the this value.
+  2. Perform ? RequireInternalSlot(O, [[ArrayBufferMaxByteLength]]).
+  [...]
+features: [resizable-arraybuffer, Symbol, BigInt]
+---*/
+
+assert.sameValue(typeof ArrayBuffer.prototype.resize, "function");
+
+assert.throws(TypeError, function() {
+  ArrayBuffer.prototype.resize.call(undefined);
+}, "`this` value is undefined");
+
+assert.throws(TypeError, function() {
+  ArrayBuffer.prototype.resize.call(null);
+}, "`this` value is null");
+
+assert.throws(TypeError, function() {
+  ArrayBuffer.prototype.resize.call(true);
+}, "`this` value is Boolean");
+
+assert.throws(TypeError, function() {
+  ArrayBuffer.prototype.resize.call("");
+}, "`this` value is String");
+
+var symbol = Symbol();
+assert.throws(TypeError, function() {
+  ArrayBuffer.prototype.resize.call(symbol);
+}, "`this` value is Symbol");
+
+assert.throws(TypeError, function() {
+  ArrayBuffer.prototype.resize.call(1);
+}, "`this` value is Number");
+
+assert.throws(TypeError, function() {
+  ArrayBuffer.prototype.resize.call(1n);
+}, "`this` value is bigint");

+ 38 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/this-is-not-resizable-arraybuffer-object.js

@@ -0,0 +1,38 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-arraybuffer.prototype.resize
+description: >
+  Throws a TypeError if `this` does not have an [[ArrayBufferMaxByteLength]] internal slot.
+info: |
+  ArrayBuffer.prototype.resize ( newLength )
+
+  1. Let O be the this value.
+  2. Perform ? RequireInternalSlot(O, [[ArrayBufferMaxByteLength]]).
+  [...]
+features: [resizable-arraybuffer]
+---*/
+
+var ab;
+
+assert.sameValue(typeof ArrayBuffer.prototype.resize, 'function');
+
+ab = new ArrayBuffer(4);
+assert.throws(TypeError, function() {
+  ab.resize(0);
+}, 'zero byte length');
+
+ab = new ArrayBuffer(4);
+assert.throws(TypeError, function() {
+  ab.resize(3);
+}, 'smaller byte length');
+
+ab = new ArrayBuffer(4);
+assert.throws(TypeError, function() {
+  ab.resize(4);
+}, 'same byte length');
+
+ab = new ArrayBuffer(4);
+assert.throws(TypeError, function() {
+  ab.resize(5);
+}, 'larger byte length');

+ 20 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/resize/this-is-sharedarraybuffer.js

@@ -0,0 +1,20 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-arraybuffer.prototype.resize
+description: Throws a TypeError if `this` value is a SharedArrayBuffer
+info: |
+  ArrayBuffer.prototype.resize ( newLength )
+
+  1. Let O be the this value.
+  2. Perform ? RequireInternalSlot(O, [[ArrayBufferMaxByteLength]]).
+  3. If IsSharedArrayBuffer(O) is true, throw a TypeError exception.
+  [...]
+features: [SharedArrayBuffer, resizable-arraybuffer]
+---*/
+
+var sab = new SharedArrayBuffer(0);
+
+assert.throws(TypeError, function() {
+  ArrayBuffer.prototype.resize.call(sab);
+}, '`this` value cannot be a SharedArrayBuffer');

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/context-is-not-arraybuffer-object.js

@@ -3,7 +3,6 @@
 
 /*---
 esid: sec-arraybuffer.prototype.slice
-es6id: 24.1.4.3
 description: >
   Throws a TypeError if `this` does not have an [[ArrayBufferData]] internal slot.
 info: |

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/context-is-not-object.js

@@ -3,7 +3,6 @@
 
 /*---
 esid: sec-arraybuffer.prototype.slice
-es6id: 24.1.4.3
 description: >
   Throws a TypeError if `this` is not an Object.
 info: |

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/descriptor.js

@@ -3,7 +3,6 @@
 
 /*---
 esid: sec-arraybuffer.prototype.slice
-es6id: 24.1.4.3
 description: >
   ArrayBuffer.prototype.slice has default data property attributes.
 info: |

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/end-default-if-absent.js

@@ -3,7 +3,6 @@
 
 /*---
 esid: sec-arraybuffer.prototype.slice
-es6id: 24.1.4.3
 description: >
   The `end` index defaults to [[ArrayBufferByteLength]] if absent.
 info: |

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/end-default-if-undefined.js

@@ -3,7 +3,6 @@
 
 /*---
 esid: sec-arraybuffer.prototype.slice
-es6id: 24.1.4.3
 description: >
   The `end` index defaults to [[ArrayBufferByteLength]] if undefined.
 info: |

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/end-exceeds-length.js

@@ -3,7 +3,6 @@
 
 /*---
 esid: sec-arraybuffer.prototype.slice
-es6id: 24.1.4.3
 description: >
   Large `end` index is clamped to [[ArrayBufferByteLength]].
 info: |

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/extensible.js

@@ -3,7 +3,6 @@
 
 /*---
 esid: sec-arraybuffer.prototype.slice
-es6id: 24.1.4.3
 description: >
   ArrayBuffer.prototype.slice is extensible.
 info: |

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/length.js

@@ -3,7 +3,6 @@
 
 /*---
 esid: sec-arraybuffer.prototype.slice
-es6id: 24.1.4.3
 description: >
   ArrayBuffer.prototype.slice.length is 2.
 info: |

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/name.js

@@ -3,7 +3,6 @@
 
 /*---
 esid: sec-arraybuffer.prototype.slice
-es6id: 24.1.4.3
 description: >
   ArrayBuffer.prototype.slice.name is "slice".
 info: |

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/negative-end.js

@@ -3,7 +3,6 @@
 
 /*---
 esid: sec-arraybuffer.prototype.slice
-es6id: 24.1.4.3
 description: >
   Negative `end` index is relative to [[ArrayBufferByteLength]].
 info: |

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/negative-start.js

@@ -3,7 +3,6 @@
 
 /*---
 esid: sec-arraybuffer.prototype.slice
-es6id: 24.1.4.3
 description: >
   Negative `start` index is relative to [[ArrayBufferByteLength]].
 info: |

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/nonconstructor.js

@@ -3,7 +3,6 @@
 
 /*---
 esid: sec-arraybuffer.prototype.slice
-es6id: 24.1.4.3
 description: >
   ArrayBuffer.prototype.slice is not a constructor function.
 info: |

+ 33 - 0
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/not-a-constructor.js

@@ -0,0 +1,33 @@
+// Copyright (C) 2020 Rick Waldron. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-ecmascript-standard-built-in-objects
+description: >
+  ArrayBuffer.prototype.slice does not implement [[Construct]], is not new-able
+info: |
+  ECMAScript Function Objects
+
+  Built-in function objects that are not identified as constructors do not
+  implement the [[Construct]] internal method unless otherwise specified in
+  the description of a particular function.
+
+  sec-evaluatenew
+
+  ...
+  7. If IsConstructor(constructor) is false, throw a TypeError exception.
+  ...
+includes: [isConstructor.js]
+features: [Reflect.construct, ArrayBuffer, arrow-function]
+---*/
+
+assert.sameValue(
+  isConstructor(ArrayBuffer.prototype.slice),
+  false,
+  'isConstructor(ArrayBuffer.prototype.slice) must return false'
+);
+
+assert.throws(TypeError, () => {
+  let ab = new ArrayBuffer(); new ab.slice();
+}, '`let ab = new ArrayBuffer(); new ab.slice()` throws TypeError');
+

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/number-conversion.js

@@ -3,7 +3,6 @@
 
 /*---
 esid: sec-arraybuffer.prototype.slice
-es6id: 24.1.4.3
 description: >
   ToInteger(start) is called before ToInteger(end).
 info: |

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/species-constructor-is-not-object.js

@@ -3,7 +3,6 @@
 
 /*---
 esid: sec-arraybuffer.prototype.slice
-es6id: 24.1.4.3
 description: >
   Throws TypeError if `constructor` property is not an object.
 info: |

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/species-constructor-is-undefined.js

@@ -3,7 +3,6 @@
 
 /*---
 esid: sec-arraybuffer.prototype.slice
-es6id: 24.1.4.3
 description: >
   Uses default constructor is `constructor` property is undefined.
 info: |

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/species-is-not-constructor.js

@@ -3,7 +3,6 @@
 
 /*---
 esid: sec-arraybuffer.prototype.slice
-es6id: 24.1.4.3
 description: >
   Throws a TypeError if species constructor is not a constructor function.
 info: |

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/species-is-not-object.js

@@ -3,7 +3,6 @@
 
 /*---
 esid: sec-arraybuffer.prototype.slice
-es6id: 24.1.4.3
 description: >
   Throws a TypeError if species constructor is not an object.
 info: |

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/species-is-null.js

@@ -3,7 +3,6 @@
 
 /*---
 esid: sec-arraybuffer.prototype.slice
-es6id: 24.1.4.3
 description: >
   Uses default constructor is species constructor is null.
 info: |

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/species-is-undefined.js

@@ -3,7 +3,6 @@
 
 /*---
 esid: sec-arraybuffer.prototype.slice
-es6id: 24.1.4.3
 description: >
   Uses default constructor is species constructor is undefined.
 info: |

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/species-returns-larger-arraybuffer.js

@@ -3,7 +3,6 @@
 
 /*---
 esid: sec-arraybuffer.prototype.slice
-es6id: 24.1.4.3
 description: >
   Does not throw TypeError if new ArrayBuffer is too large.
 info: |

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/species-returns-not-arraybuffer.js

@@ -3,7 +3,6 @@
 
 /*---
 esid: sec-arraybuffer.prototype.slice
-es6id: 24.1.4.3
 description: >
   Throws a TypeError if new object is not an ArrayBuffer instance.
 info: |

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/species-returns-same-arraybuffer.js

@@ -3,7 +3,6 @@
 
 /*---
 esid: sec-arraybuffer.prototype.slice
-es6id: 24.1.4.3
 description: >
   Throws a TypeError if species constructor returns `this` value.
 info: |

+ 0 - 1
Jint.Tests.Test262/test/built-ins/ArrayBuffer/prototype/slice/species-returns-smaller-arraybuffer.js

@@ -3,7 +3,6 @@
 
 /*---
 esid: sec-arraybuffer.prototype.slice
-es6id: 24.1.4.3
 description: >
   Throws a TypeError if new ArrayBuffer is too small.
 info: |

Some files were not shown because too many files changed in this diff