use proper isConstructor check for recently added ArrayBuffer/SharedArrayBuffer tests

This commit is contained in:
Jordan Harband 2023-07-24 13:26:12 -07:00 committed by Ms2ger
parent 9efb4f8e53
commit eb613f6891
6 changed files with 18 additions and 23 deletions

View File

@ -11,13 +11,11 @@ info: |
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]
includes: [isConstructor.js]
features: [resizable-arraybuffer, Reflect.construct]
---*/
assert.sameValue(
Object.prototype.hasOwnProperty.call(ArrayBuffer.prototype.resize, 'prototype'),
false
);
assert(!isConstructor(ArrayBuffer.prototype.resize), "ArrayBuffer.prototype.resize is not a constructor");
var arrayBuffer = new ArrayBuffer(8);
assert.throws(TypeError, function() {

View File

@ -12,9 +12,11 @@ info: |
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.
includes: [isConstructor.js]
features: [Reflect.construct]
---*/
assert.sameValue(Object.prototype.hasOwnProperty.call(ArrayBuffer.prototype.slice, "prototype"), false);
assert(!isConstructor(ArrayBuffer.prototype.slice), "ArrayBuffer.prototype.slice is not a constructor");
var arrayBuffer = new ArrayBuffer(8);
assert.throws(TypeError, function() {

View File

@ -11,13 +11,11 @@ info: |
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: [arraybuffer-transfer]
includes: [isConstructor.js]
features: [arraybuffer-transfer, Reflect.construct]
---*/
assert.sameValue(
Object.prototype.hasOwnProperty.call(ArrayBuffer.prototype.transfer, 'prototype'),
false
);
assert(!isConstructor(ArrayBuffer.prototype.transfer), "ArrayBuffer.prototype.transfer is not a constructor");
var arrayBuffer = new ArrayBuffer(8);
assert.throws(TypeError, function() {

View File

@ -11,13 +11,11 @@ info: |
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: [arraybuffer-transfer]
includes: [isConstructor.js]
features: [arraybuffer-transfer, Reflect.construct]
---*/
assert.sameValue(
Object.prototype.hasOwnProperty.call(ArrayBuffer.prototype.transferToFixedLength, 'prototype'),
false
);
assert(!isConstructor(ArrayBuffer.prototype.transferToFixedLength), "ArrayBuffer.prototype.transferToFixedLength is not a constructor");
var arrayBuffer = new ArrayBuffer(8);
assert.throws(TypeError, function() {

View File

@ -11,13 +11,11 @@ info: |
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: [SharedArrayBuffer, resizable-arraybuffer]
includes: [isConstructor.js]
features: [SharedArrayBuffer, resizable-arraybuffer, Reflect.construct]
---*/
assert.sameValue(
Object.prototype.hasOwnProperty.call(SharedArrayBuffer.prototype.grow, 'prototype'),
false
);
assert(!isConstructor(SharedArrayBuffer.prototype.grow), "SharedArrayBuffer.prototype.grow is not a constructor");
var arrayBuffer = new SharedArrayBuffer(8);
assert.throws(TypeError, function() {

View File

@ -12,10 +12,11 @@ info: |
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: [SharedArrayBuffer]
includes: [isConstructor.js]
features: [SharedArrayBuffer, Reflect.construct]
---*/
assert.sameValue(Object.prototype.hasOwnProperty.call(SharedArrayBuffer.prototype.slice, "prototype"), false);
assert(!isConstructor(SharedArrayBuffer.prototype.slice), "SharedArrayBuffer.prototype.slice is not a constructor");
var arrayBuffer = new SharedArrayBuffer(8);
assert.throws(TypeError, function() {