mirror of
https://github.com/tc39/test262.git
synced 2025-07-23 22:15:24 +02:00
Built-in function objects that are not identified as constructors must throw a TypeError exception when new'ed. Fixes gh-1739
This commit is contained in:
parent
ce8ec71c98
commit
c644ede430
27
test/annexB/built-ins/Date/prototype/getYear/not-a-constructor.js
vendored
Normal file
27
test/annexB/built-ins/Date/prototype/getYear/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
Date.prototype.getYear does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(Date.prototype.getYear),
|
||||
false,
|
||||
'isConstructor(Date.prototype.getYear) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
let date = new Date(Date.now()); new date.getYear();
|
||||
}, '`let date = new Date(Date.now()); new date.getYear()` throws TypeError');
|
||||
|
27
test/annexB/built-ins/Date/prototype/setYear/not-a-constructor.js
vendored
Normal file
27
test/annexB/built-ins/Date/prototype/setYear/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
Date.prototype.setYear does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(Date.prototype.setYear),
|
||||
false,
|
||||
'isConstructor(Date.prototype.setYear) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
let date = new Date(Date.now()); new date.setYear();
|
||||
}, '`let date = new Date(Date.now()); new date.setYear()` throws TypeError');
|
||||
|
27
test/annexB/built-ins/Date/prototype/toGMTString/not-a-constructor.js
vendored
Normal file
27
test/annexB/built-ins/Date/prototype/toGMTString/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
Date.prototype.toGMTString does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(Date.prototype.toGMTString),
|
||||
false,
|
||||
'isConstructor(Date.prototype.toGMTString) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
let date = new Date(Date.now()); new date.toGMTString();
|
||||
}, '`let date = new Date(Date.now()); new date.toGMTString()` throws TypeError');
|
||||
|
27
test/annexB/built-ins/String/prototype/anchor/not-a-constructor.js
vendored
Normal file
27
test/annexB/built-ins/String/prototype/anchor/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
String.prototype.anchor does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(String.prototype.anchor),
|
||||
false,
|
||||
'isConstructor(String.prototype.anchor) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new String.prototype.anchor();
|
||||
}, '`new String.prototype.anchor()` throws TypeError');
|
||||
|
23
test/annexB/built-ins/String/prototype/big/not-a-constructor.js
vendored
Normal file
23
test/annexB/built-ins/String/prototype/big/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
// 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: >
|
||||
String.prototype.big does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(isConstructor(String.prototype.big), false, 'isConstructor(String.prototype.big) must return false');
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new String.prototype.big();
|
||||
}, '`new String.prototype.big()` throws TypeError');
|
||||
|
27
test/annexB/built-ins/String/prototype/blink/not-a-constructor.js
vendored
Normal file
27
test/annexB/built-ins/String/prototype/blink/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
String.prototype.blink does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(String.prototype.blink),
|
||||
false,
|
||||
'isConstructor(String.prototype.blink) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new String.prototype.blink();
|
||||
}, '`new String.prototype.blink()` throws TypeError');
|
||||
|
27
test/annexB/built-ins/String/prototype/bold/not-a-constructor.js
vendored
Normal file
27
test/annexB/built-ins/String/prototype/bold/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
String.prototype.bold does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(String.prototype.bold),
|
||||
false,
|
||||
'isConstructor(String.prototype.bold) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new String.prototype.bold();
|
||||
}, '`new String.prototype.bold()` throws TypeError');
|
||||
|
27
test/annexB/built-ins/String/prototype/fixed/not-a-constructor.js
vendored
Normal file
27
test/annexB/built-ins/String/prototype/fixed/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
String.prototype.fixed does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(String.prototype.fixed),
|
||||
false,
|
||||
'isConstructor(String.prototype.fixed) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new String.prototype.fixed();
|
||||
}, '`new String.prototype.fixed()` throws TypeError');
|
||||
|
27
test/annexB/built-ins/String/prototype/fontcolor/not-a-constructor.js
vendored
Normal file
27
test/annexB/built-ins/String/prototype/fontcolor/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
String.prototype.fontcolor does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(String.prototype.fontcolor),
|
||||
false,
|
||||
'isConstructor(String.prototype.fontcolor) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new String.prototype.fontcolor();
|
||||
}, '`new String.prototype.fontcolor()` throws TypeError');
|
||||
|
27
test/annexB/built-ins/String/prototype/fontsize/not-a-constructor.js
vendored
Normal file
27
test/annexB/built-ins/String/prototype/fontsize/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
String.prototype.fontsize does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(String.prototype.fontsize),
|
||||
false,
|
||||
'isConstructor(String.prototype.fontsize) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new String.prototype.fontsize();
|
||||
}, '`new String.prototype.fontsize()` throws TypeError');
|
||||
|
27
test/annexB/built-ins/String/prototype/italics/not-a-constructor.js
vendored
Normal file
27
test/annexB/built-ins/String/prototype/italics/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
String.prototype.italics does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(String.prototype.italics),
|
||||
false,
|
||||
'isConstructor(String.prototype.italics) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new String.prototype.italics();
|
||||
}, '`new String.prototype.italics()` throws TypeError');
|
||||
|
27
test/annexB/built-ins/String/prototype/link/not-a-constructor.js
vendored
Normal file
27
test/annexB/built-ins/String/prototype/link/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
String.prototype.link does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(String.prototype.link),
|
||||
false,
|
||||
'isConstructor(String.prototype.link) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new String.prototype.link();
|
||||
}, '`new String.prototype.link()` throws TypeError');
|
||||
|
27
test/annexB/built-ins/String/prototype/small/not-a-constructor.js
vendored
Normal file
27
test/annexB/built-ins/String/prototype/small/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
String.prototype.small does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(String.prototype.small),
|
||||
false,
|
||||
'isConstructor(String.prototype.small) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new String.prototype.small();
|
||||
}, '`new String.prototype.small()` throws TypeError');
|
||||
|
27
test/annexB/built-ins/String/prototype/strike/not-a-constructor.js
vendored
Normal file
27
test/annexB/built-ins/String/prototype/strike/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
String.prototype.strike does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(String.prototype.strike),
|
||||
false,
|
||||
'isConstructor(String.prototype.strike) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new String.prototype.strike();
|
||||
}, '`new String.prototype.strike()` throws TypeError');
|
||||
|
23
test/annexB/built-ins/String/prototype/sub/not-a-constructor.js
vendored
Normal file
23
test/annexB/built-ins/String/prototype/sub/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
// 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: >
|
||||
String.prototype.sub does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(isConstructor(String.prototype.sub), false, 'isConstructor(String.prototype.sub) must return false');
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new String.prototype.sub();
|
||||
}, '`new String.prototype.sub()` throws TypeError');
|
||||
|
27
test/annexB/built-ins/String/prototype/substr/not-a-constructor.js
vendored
Normal file
27
test/annexB/built-ins/String/prototype/substr/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
String.prototype.substr does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(String.prototype.substr),
|
||||
false,
|
||||
'isConstructor(String.prototype.substr) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new String.prototype.substr();
|
||||
}, '`new String.prototype.substr()` throws TypeError');
|
||||
|
23
test/annexB/built-ins/String/prototype/sup/not-a-constructor.js
vendored
Normal file
23
test/annexB/built-ins/String/prototype/sup/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
// 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: >
|
||||
String.prototype.sup does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(isConstructor(String.prototype.sup), false, 'isConstructor(String.prototype.sup) must return false');
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new String.prototype.sup();
|
||||
}, '`new String.prototype.sup()` throws TypeError');
|
||||
|
23
test/annexB/built-ins/escape/not-a-constructor.js
Normal file
23
test/annexB/built-ins/escape/not-a-constructor.js
Normal file
@ -0,0 +1,23 @@
|
||||
// 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: >
|
||||
escape does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(isConstructor(escape), false, 'isConstructor(escape) must return false');
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new escape('');
|
||||
}, '`new escape(\'\')` throws TypeError');
|
||||
|
23
test/annexB/built-ins/unescape/not-a-constructor.js
Normal file
23
test/annexB/built-ins/unescape/not-a-constructor.js
Normal file
@ -0,0 +1,23 @@
|
||||
// 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: >
|
||||
unescape does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(isConstructor(unescape), false, 'isConstructor(unescape) must return false');
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new unescape('');
|
||||
}, '`new unescape(\'\')` throws TypeError');
|
||||
|
23
test/built-ins/Array/from/not-a-constructor.js
Normal file
23
test/built-ins/Array/from/not-a-constructor.js
Normal file
@ -0,0 +1,23 @@
|
||||
// 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: >
|
||||
Array.from does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(isConstructor(Array.from), false, 'isConstructor(Array.from) must return false');
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Array.from([]);
|
||||
}, '`new Array.from([])` throws TypeError');
|
||||
|
23
test/built-ins/Array/isArray/not-a-constructor.js
Normal file
23
test/built-ins/Array/isArray/not-a-constructor.js
Normal file
@ -0,0 +1,23 @@
|
||||
// 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: >
|
||||
Array.isArray does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(isConstructor(Array.isArray), false, 'isConstructor(Array.isArray) must return false');
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Array.isArray([]);
|
||||
}, '`new Array.isArray([])` throws TypeError');
|
||||
|
@ -1,11 +1,23 @@
|
||||
// Copyright (C) 2015 the V8 project authors. All rights reserved.
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-array.of
|
||||
esid: sec-ecmascript-standard-built-in-objects
|
||||
description: >
|
||||
Array.of is not a constructor.
|
||||
Array.of does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
new Array.of();
|
||||
});
|
||||
assert.sameValue(isConstructor(Array.of), false, 'isConstructor(Array.of) must return false');
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Array.of(1);
|
||||
}, '`new Array.of(1)` throws TypeError');
|
||||
|
||||
|
27
test/built-ins/Array/prototype/Symbol.iterator/not-a-constructor.js
vendored
Normal file
27
test/built-ins/Array/prototype/Symbol.iterator/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
Array.prototype[Symbol.iterator] does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, Symbol, Symbol.iterator, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(Array.prototype[Symbol.iterator]),
|
||||
false,
|
||||
'isConstructor(Array.prototype[Symbol.iterator]) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Array.prototype[Symbol.iterator]();
|
||||
}, '`new Array.prototype[Symbol.iterator]()` throws TypeError');
|
||||
|
@ -1,22 +1,27 @@
|
||||
// Copyright (C) 2017 Leo Balter. All rights reserved.
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-array.prototype.concat
|
||||
esid: sec-ecmascript-standard-built-in-objects
|
||||
description: >
|
||||
Array.prototype.concat is not a constructor.
|
||||
Array.prototype.concat does not implement [[Construct]]
|
||||
info: |
|
||||
17 ECMAScript Standard Built-in Objects
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
new Array.prototype.concat();
|
||||
});
|
||||
assert.sameValue(
|
||||
isConstructor(Array.prototype.concat),
|
||||
false,
|
||||
'isConstructor(Array.prototype.concat) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
new [].concat();
|
||||
});
|
||||
assert.throws(TypeError, () => {
|
||||
new Array.prototype.concat([]);
|
||||
}, '`new Array.prototype.concat([])` throws TypeError');
|
||||
|
||||
|
27
test/built-ins/Array/prototype/copyWithin/not-a-constructor.js
vendored
Normal file
27
test/built-ins/Array/prototype/copyWithin/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
Array.prototype.copyWithin does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(Array.prototype.copyWithin),
|
||||
false,
|
||||
'isConstructor(Array.prototype.copyWithin) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Array.prototype.copyWithin();
|
||||
}, '`new Array.prototype.copyWithin()` throws TypeError');
|
||||
|
27
test/built-ins/Array/prototype/entries/not-a-constructor.js
vendored
Normal file
27
test/built-ins/Array/prototype/entries/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
Array.prototype.entries does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(Array.prototype.entries),
|
||||
false,
|
||||
'isConstructor(Array.prototype.entries) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Array.prototype.entries();
|
||||
}, '`new Array.prototype.entries()` throws TypeError');
|
||||
|
27
test/built-ins/Array/prototype/every/not-a-constructor.js
vendored
Normal file
27
test/built-ins/Array/prototype/every/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
Array.prototype.every does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(Array.prototype.every),
|
||||
false,
|
||||
'isConstructor(Array.prototype.every) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Array.prototype.every(() => {});
|
||||
}, '`new Array.prototype.every(() => {})` throws TypeError');
|
||||
|
23
test/built-ins/Array/prototype/fill/not-a-constructor.js
vendored
Normal file
23
test/built-ins/Array/prototype/fill/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
// 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: >
|
||||
Array.prototype.fill does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(isConstructor(Array.prototype.fill), false, 'isConstructor(Array.prototype.fill) must return false');
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Array.prototype.fill();
|
||||
}, '`new Array.prototype.fill()` throws TypeError');
|
||||
|
27
test/built-ins/Array/prototype/filter/not-a-constructor.js
vendored
Normal file
27
test/built-ins/Array/prototype/filter/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
Array.prototype.filter does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(Array.prototype.filter),
|
||||
false,
|
||||
'isConstructor(Array.prototype.filter) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Array.prototype.filter(() => {});
|
||||
}, '`new Array.prototype.filter(() => {})` throws TypeError');
|
||||
|
23
test/built-ins/Array/prototype/find/not-a-constructor.js
vendored
Normal file
23
test/built-ins/Array/prototype/find/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
// 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: >
|
||||
Array.prototype.find does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(isConstructor(Array.prototype.find), false, 'isConstructor(Array.prototype.find) must return false');
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Array.prototype.find(() => {});
|
||||
}, '`new Array.prototype.find(() => {})` throws TypeError');
|
||||
|
27
test/built-ins/Array/prototype/findIndex/not-a-constructor.js
vendored
Normal file
27
test/built-ins/Array/prototype/findIndex/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
Array.prototype.findIndex does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(Array.prototype.findIndex),
|
||||
false,
|
||||
'isConstructor(Array.prototype.findIndex) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Array.prototype.findIndex(() => {});
|
||||
}, '`new Array.prototype.findIndex(() => {})` throws TypeError');
|
||||
|
23
test/built-ins/Array/prototype/flat/not-a-constructor.js
vendored
Normal file
23
test/built-ins/Array/prototype/flat/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
// 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: >
|
||||
Array.prototype.flat does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(isConstructor(Array.prototype.flat), false, 'isConstructor(Array.prototype.flat) must return false');
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Array.prototype.flat();
|
||||
}, '`new Array.prototype.flat()` throws TypeError');
|
||||
|
27
test/built-ins/Array/prototype/flatMap/not-a-constructor.js
vendored
Normal file
27
test/built-ins/Array/prototype/flatMap/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
Array.prototype.flatMap does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, Array.prototype.flatMap, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(Array.prototype.flatMap),
|
||||
false,
|
||||
'isConstructor(Array.prototype.flatMap) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Array.prototype.flatMap(() => {});
|
||||
}, '`new Array.prototype.flatMap(() => {})` throws TypeError');
|
||||
|
27
test/built-ins/Array/prototype/forEach/not-a-constructor.js
vendored
Normal file
27
test/built-ins/Array/prototype/forEach/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
Array.prototype.forEach does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(Array.prototype.forEach),
|
||||
false,
|
||||
'isConstructor(Array.prototype.forEach) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Array.prototype.forEach(() => {});
|
||||
}, '`new Array.prototype.forEach(() => {})` throws TypeError');
|
||||
|
27
test/built-ins/Array/prototype/includes/not-a-constructor.js
vendored
Normal file
27
test/built-ins/Array/prototype/includes/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
Array.prototype.includes does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(Array.prototype.includes),
|
||||
false,
|
||||
'isConstructor(Array.prototype.includes) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Array.prototype.includes(1);
|
||||
}, '`new Array.prototype.includes(1)` throws TypeError');
|
||||
|
27
test/built-ins/Array/prototype/indexOf/not-a-constructor.js
vendored
Normal file
27
test/built-ins/Array/prototype/indexOf/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
Array.prototype.indexOf does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(Array.prototype.indexOf),
|
||||
false,
|
||||
'isConstructor(Array.prototype.indexOf) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Array.prototype.indexOf();
|
||||
}, '`new Array.prototype.indexOf()` throws TypeError');
|
||||
|
23
test/built-ins/Array/prototype/join/not-a-constructor.js
vendored
Normal file
23
test/built-ins/Array/prototype/join/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
// 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: >
|
||||
Array.prototype.join does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(isConstructor(Array.prototype.join), false, 'isConstructor(Array.prototype.join) must return false');
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Array.prototype.join();
|
||||
}, '`new Array.prototype.join()` throws TypeError');
|
||||
|
23
test/built-ins/Array/prototype/keys/not-a-constructor.js
vendored
Normal file
23
test/built-ins/Array/prototype/keys/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
// 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: >
|
||||
Array.prototype.keys does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(isConstructor(Array.prototype.keys), false, 'isConstructor(Array.prototype.keys) must return false');
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Array.prototype.keys();
|
||||
}, '`new Array.prototype.keys()` throws TypeError');
|
||||
|
27
test/built-ins/Array/prototype/lastIndexOf/not-a-constructor.js
vendored
Normal file
27
test/built-ins/Array/prototype/lastIndexOf/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
Array.prototype.lastIndexOf does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(Array.prototype.lastIndexOf),
|
||||
false,
|
||||
'isConstructor(Array.prototype.lastIndexOf) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Array.prototype.lastIndexOf();
|
||||
}, '`new Array.prototype.lastIndexOf()` throws TypeError');
|
||||
|
23
test/built-ins/Array/prototype/map/not-a-constructor.js
vendored
Normal file
23
test/built-ins/Array/prototype/map/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
// 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: >
|
||||
Array.prototype.map does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(isConstructor(Array.prototype.map), false, 'isConstructor(Array.prototype.map) must return false');
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Array.prototype.map(() => {});
|
||||
}, '`new Array.prototype.map(() => {})` throws TypeError');
|
||||
|
23
test/built-ins/Array/prototype/pop/not-a-constructor.js
vendored
Normal file
23
test/built-ins/Array/prototype/pop/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
// 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: >
|
||||
Array.prototype.pop does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(isConstructor(Array.prototype.pop), false, 'isConstructor(Array.prototype.pop) must return false');
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Array.prototype.pop();
|
||||
}, '`new Array.prototype.pop()` throws TypeError');
|
||||
|
23
test/built-ins/Array/prototype/push/not-a-constructor.js
vendored
Normal file
23
test/built-ins/Array/prototype/push/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
// 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: >
|
||||
Array.prototype.push does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(isConstructor(Array.prototype.push), false, 'isConstructor(Array.prototype.push) must return false');
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Array.prototype.push();
|
||||
}, '`new Array.prototype.push()` throws TypeError');
|
||||
|
27
test/built-ins/Array/prototype/reduce/not-a-constructor.js
vendored
Normal file
27
test/built-ins/Array/prototype/reduce/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
Array.prototype.reduce does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(Array.prototype.reduce),
|
||||
false,
|
||||
'isConstructor(Array.prototype.reduce) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Array.prototype.reduce(() => {}, []);
|
||||
}, '`new Array.prototype.reduce(() => {}, [])` throws TypeError');
|
||||
|
27
test/built-ins/Array/prototype/reduceRight/not-a-constructor.js
vendored
Normal file
27
test/built-ins/Array/prototype/reduceRight/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
Array.prototype.reduceRight does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(Array.prototype.reduceRight),
|
||||
false,
|
||||
'isConstructor(Array.prototype.reduceRight) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Array.prototype.reduceRight(() => {}, []);
|
||||
}, '`new Array.prototype.reduceRight(() => {}, [])` throws TypeError');
|
||||
|
27
test/built-ins/Array/prototype/reverse/not-a-constructor.js
vendored
Normal file
27
test/built-ins/Array/prototype/reverse/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
Array.prototype.reverse does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(Array.prototype.reverse),
|
||||
false,
|
||||
'isConstructor(Array.prototype.reverse) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Array.prototype.reverse();
|
||||
}, '`new Array.prototype.reverse()` throws TypeError');
|
||||
|
27
test/built-ins/Array/prototype/shift/not-a-constructor.js
vendored
Normal file
27
test/built-ins/Array/prototype/shift/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
Array.prototype.shift does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(Array.prototype.shift),
|
||||
false,
|
||||
'isConstructor(Array.prototype.shift) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Array.prototype.shift();
|
||||
}, '`new Array.prototype.shift()` throws TypeError');
|
||||
|
27
test/built-ins/Array/prototype/slice/not-a-constructor.js
vendored
Normal file
27
test/built-ins/Array/prototype/slice/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
Array.prototype.slice does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(Array.prototype.slice),
|
||||
false,
|
||||
'isConstructor(Array.prototype.slice) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Array.prototype.slice();
|
||||
}, '`new Array.prototype.slice()` throws TypeError');
|
||||
|
23
test/built-ins/Array/prototype/some/not-a-constructor.js
vendored
Normal file
23
test/built-ins/Array/prototype/some/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
// 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: >
|
||||
Array.prototype.some does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(isConstructor(Array.prototype.some), false, 'isConstructor(Array.prototype.some) must return false');
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Array.prototype.some(() => {});
|
||||
}, '`new Array.prototype.some(() => {})` throws TypeError');
|
||||
|
23
test/built-ins/Array/prototype/sort/not-a-constructor.js
vendored
Normal file
23
test/built-ins/Array/prototype/sort/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
// 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: >
|
||||
Array.prototype.sort does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(isConstructor(Array.prototype.sort), false, 'isConstructor(Array.prototype.sort) must return false');
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Array.prototype.sort();
|
||||
}, '`new Array.prototype.sort()` throws TypeError');
|
||||
|
27
test/built-ins/Array/prototype/splice/not-a-constructor.js
vendored
Normal file
27
test/built-ins/Array/prototype/splice/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
Array.prototype.splice does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(Array.prototype.splice),
|
||||
false,
|
||||
'isConstructor(Array.prototype.splice) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Array.prototype.splice();
|
||||
}, '`new Array.prototype.splice()` throws TypeError');
|
||||
|
27
test/built-ins/Array/prototype/toLocaleString/not-a-constructor.js
vendored
Normal file
27
test/built-ins/Array/prototype/toLocaleString/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
Array.prototype.toLocaleString does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(Array.prototype.toLocaleString),
|
||||
false,
|
||||
'isConstructor(Array.prototype.toLocaleString) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Array.prototype.toLocaleString();
|
||||
}, '`new Array.prototype.toLocaleString()` throws TypeError');
|
||||
|
27
test/built-ins/Array/prototype/toString/not-a-constructor.js
vendored
Normal file
27
test/built-ins/Array/prototype/toString/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
Array.prototype.toString does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(Array.prototype.toString),
|
||||
false,
|
||||
'isConstructor(Array.prototype.toString) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Array.prototype.toString();
|
||||
}, '`new Array.prototype.toString()` throws TypeError');
|
||||
|
27
test/built-ins/Array/prototype/unshift/not-a-constructor.js
vendored
Normal file
27
test/built-ins/Array/prototype/unshift/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
Array.prototype.unshift does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(Array.prototype.unshift),
|
||||
false,
|
||||
'isConstructor(Array.prototype.unshift) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Array.prototype.unshift();
|
||||
}, '`new Array.prototype.unshift()` throws TypeError');
|
||||
|
27
test/built-ins/Array/prototype/values/not-a-constructor.js
vendored
Normal file
27
test/built-ins/Array/prototype/values/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
Array.prototype.values does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, Array.prototype.values, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(Array.prototype.values),
|
||||
false,
|
||||
'isConstructor(Array.prototype.values) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Array.prototype.values();
|
||||
}, '`new Array.prototype.values()` throws TypeError');
|
||||
|
23
test/built-ins/ArrayBuffer/isView/not-a-constructor.js
Normal file
23
test/built-ins/ArrayBuffer/isView/not-a-constructor.js
Normal file
@ -0,0 +1,23 @@
|
||||
// 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]]
|
||||
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.
|
||||
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');
|
||||
|
27
test/built-ins/ArrayBuffer/prototype/slice/not-a-constructor.js
vendored
Normal file
27
test/built-ins/ArrayBuffer/prototype/slice/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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]]
|
||||
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.
|
||||
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');
|
||||
|
23
test/built-ins/Atomics/add/not-a-constructor.js
Normal file
23
test/built-ins/Atomics/add/not-a-constructor.js
Normal file
@ -0,0 +1,23 @@
|
||||
// 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: >
|
||||
Atomics.add does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, Atomics, arrow-function, TypedArray, SharedArrayBuffer]
|
||||
---*/
|
||||
|
||||
assert.sameValue(isConstructor(Atomics.add), false, 'isConstructor(Atomics.add) must return false');
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Atomics.add(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)));
|
||||
}, '`new Atomics.add(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)))` throws TypeError');
|
||||
|
23
test/built-ins/Atomics/and/not-a-constructor.js
Normal file
23
test/built-ins/Atomics/and/not-a-constructor.js
Normal file
@ -0,0 +1,23 @@
|
||||
// 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: >
|
||||
Atomics.and does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, Atomics, arrow-function, TypedArray, SharedArrayBuffer]
|
||||
---*/
|
||||
|
||||
assert.sameValue(isConstructor(Atomics.and), false, 'isConstructor(Atomics.and) must return false');
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Atomics.and(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)));
|
||||
}, '`new Atomics.and(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)))` throws TypeError');
|
||||
|
27
test/built-ins/Atomics/compareExchange/not-a-constructor.js
Normal file
27
test/built-ins/Atomics/compareExchange/not-a-constructor.js
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
Atomics.compareExchange does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, Atomics, arrow-function, TypedArray, SharedArrayBuffer]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(Atomics.compareExchange),
|
||||
false,
|
||||
'isConstructor(Atomics.compareExchange) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Atomics.compareExchange(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)));
|
||||
}, '`new Atomics.compareExchange(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)))` throws TypeError');
|
||||
|
23
test/built-ins/Atomics/exchange/not-a-constructor.js
Normal file
23
test/built-ins/Atomics/exchange/not-a-constructor.js
Normal file
@ -0,0 +1,23 @@
|
||||
// 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: >
|
||||
Atomics.exchange does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, Atomics, arrow-function, TypedArray, SharedArrayBuffer]
|
||||
---*/
|
||||
|
||||
assert.sameValue(isConstructor(Atomics.exchange), false, 'isConstructor(Atomics.exchange) must return false');
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Atomics.exchange(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)));
|
||||
}, '`new Atomics.exchange(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)))` throws TypeError');
|
||||
|
23
test/built-ins/Atomics/isLockFree/not-a-constructor.js
Normal file
23
test/built-ins/Atomics/isLockFree/not-a-constructor.js
Normal file
@ -0,0 +1,23 @@
|
||||
// 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: >
|
||||
Atomics.isLockFree does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, Atomics, arrow-function, TypedArray, SharedArrayBuffer]
|
||||
---*/
|
||||
|
||||
assert.sameValue(isConstructor(Atomics.isLockFree), false, 'isConstructor(Atomics.isLockFree) must return false');
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Atomics.isLockFree(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)));
|
||||
}, '`new Atomics.isLockFree(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)))` throws TypeError');
|
||||
|
23
test/built-ins/Atomics/load/not-a-constructor.js
Normal file
23
test/built-ins/Atomics/load/not-a-constructor.js
Normal file
@ -0,0 +1,23 @@
|
||||
// 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: >
|
||||
Atomics.load does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, Atomics, arrow-function, TypedArray, SharedArrayBuffer]
|
||||
---*/
|
||||
|
||||
assert.sameValue(isConstructor(Atomics.load), false, 'isConstructor(Atomics.load) must return false');
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Atomics.load(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)));
|
||||
}, '`new Atomics.load(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)))` throws TypeError');
|
||||
|
23
test/built-ins/Atomics/notify/not-a-constructor.js
Normal file
23
test/built-ins/Atomics/notify/not-a-constructor.js
Normal file
@ -0,0 +1,23 @@
|
||||
// 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: >
|
||||
Atomics.notify does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, Atomics, arrow-function, TypedArray, SharedArrayBuffer]
|
||||
---*/
|
||||
|
||||
assert.sameValue(isConstructor(Atomics.notify), false, 'isConstructor(Atomics.notify) must return false');
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Atomics.notify(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)));
|
||||
}, '`new Atomics.notify(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)))` throws TypeError');
|
||||
|
23
test/built-ins/Atomics/or/not-a-constructor.js
Normal file
23
test/built-ins/Atomics/or/not-a-constructor.js
Normal file
@ -0,0 +1,23 @@
|
||||
// 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: >
|
||||
Atomics.or does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, Atomics, arrow-function, TypedArray, SharedArrayBuffer]
|
||||
---*/
|
||||
|
||||
assert.sameValue(isConstructor(Atomics.or), false, 'isConstructor(Atomics.or) must return false');
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Atomics.or(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)));
|
||||
}, '`new Atomics.or(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)))` throws TypeError');
|
||||
|
23
test/built-ins/Atomics/store/not-a-constructor.js
Normal file
23
test/built-ins/Atomics/store/not-a-constructor.js
Normal file
@ -0,0 +1,23 @@
|
||||
// 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: >
|
||||
Atomics.store does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, Atomics, arrow-function, TypedArray, SharedArrayBuffer]
|
||||
---*/
|
||||
|
||||
assert.sameValue(isConstructor(Atomics.store), false, 'isConstructor(Atomics.store) must return false');
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Atomics.store(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)));
|
||||
}, '`new Atomics.store(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)))` throws TypeError');
|
||||
|
23
test/built-ins/Atomics/sub/not-a-constructor.js
Normal file
23
test/built-ins/Atomics/sub/not-a-constructor.js
Normal file
@ -0,0 +1,23 @@
|
||||
// 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: >
|
||||
Atomics.sub does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, Atomics, arrow-function, TypedArray, SharedArrayBuffer]
|
||||
---*/
|
||||
|
||||
assert.sameValue(isConstructor(Atomics.sub), false, 'isConstructor(Atomics.sub) must return false');
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Atomics.sub(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)));
|
||||
}, '`new Atomics.sub(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)))` throws TypeError');
|
||||
|
23
test/built-ins/Atomics/xor/not-a-constructor.js
Normal file
23
test/built-ins/Atomics/xor/not-a-constructor.js
Normal file
@ -0,0 +1,23 @@
|
||||
// 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: >
|
||||
Atomics.xor does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, Atomics, arrow-function, TypedArray, SharedArrayBuffer]
|
||||
---*/
|
||||
|
||||
assert.sameValue(isConstructor(Atomics.xor), false, 'isConstructor(Atomics.xor) must return false');
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Atomics.xor(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)));
|
||||
}, '`new Atomics.xor(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)))` throws TypeError');
|
||||
|
20
test/built-ins/BigInt/asIntN/not-a-constructor.js
Normal file
20
test/built-ins/BigInt/asIntN/not-a-constructor.js
Normal file
@ -0,0 +1,20 @@
|
||||
// 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: >
|
||||
BigInt.asIntN does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, BigInt, arrow-function]
|
||||
---*/
|
||||
assert.sameValue(isConstructor(BigInt.asIntN), false, 'isConstructor(BigInt.asIntN) must return false');
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new BigInt.asIntN(64, 1n);
|
||||
}, '`new BigInt.asIntN(64, 1n)` throws TypeError');
|
20
test/built-ins/BigInt/asUintN/not-a-constructor.js
Normal file
20
test/built-ins/BigInt/asUintN/not-a-constructor.js
Normal file
@ -0,0 +1,20 @@
|
||||
// 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: >
|
||||
BigInt.asUintN does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, BigInt, arrow-function]
|
||||
---*/
|
||||
assert.sameValue(isConstructor(BigInt.asUintN), false, 'isConstructor(BigInt.asUintN) must return false');
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new BigInt.asUintN(64, 1n);
|
||||
}, '`new BigInt.asUintN(64, 1n)` throws TypeError');
|
25
test/built-ins/BigInt/prototype/toLocaleString/not-a-constructor.js
vendored
Normal file
25
test/built-ins/BigInt/prototype/toLocaleString/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
// 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: >
|
||||
BigInt.prototype.toLocaleString does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, BigInt, arrow-function]
|
||||
---*/
|
||||
assert.sameValue(
|
||||
isConstructor(BigInt.prototype.toLocaleString),
|
||||
false,
|
||||
'isConstructor(BigInt.prototype.toLocaleString) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
let n = 1n;
|
||||
new n.toLocaleString();
|
||||
}, '`let n = 1n; new n.toLocaleString()` throws TypeError');
|
25
test/built-ins/BigInt/prototype/toString/not-a-constructor.js
vendored
Normal file
25
test/built-ins/BigInt/prototype/toString/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
// 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: >
|
||||
BigInt.prototype.toString does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, BigInt, arrow-function]
|
||||
---*/
|
||||
assert.sameValue(
|
||||
isConstructor(BigInt.prototype.toString),
|
||||
false,
|
||||
'isConstructor(BigInt.prototype.toString) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
let n = 1n;
|
||||
new n.toString();
|
||||
}, '`let n = 1n; new n.toString()` throws TypeError');
|
25
test/built-ins/BigInt/prototype/valueOf/not-a-constructor.js
vendored
Normal file
25
test/built-ins/BigInt/prototype/valueOf/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
// 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: >
|
||||
BigInt.prototype.valueOf does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, BigInt, arrow-function]
|
||||
---*/
|
||||
assert.sameValue(
|
||||
isConstructor(BigInt.prototype.valueOf),
|
||||
false,
|
||||
'isConstructor(BigInt.prototype.valueOf) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
let n = 1n;
|
||||
new n.valueOf();
|
||||
}, '`let n = 1n; new n.valueOf()` throws TypeError');
|
27
test/built-ins/Boolean/prototype/toString/not-a-constructor.js
vendored
Normal file
27
test/built-ins/Boolean/prototype/toString/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
Boolean.prototype.toString does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(Boolean.prototype.toString),
|
||||
false,
|
||||
'isConstructor(Boolean.prototype.toString) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Boolean.prototype.toString();
|
||||
}, '`new Boolean.prototype.toString()` throws TypeError');
|
||||
|
27
test/built-ins/Boolean/prototype/valueOf/not-a-constructor.js
vendored
Normal file
27
test/built-ins/Boolean/prototype/valueOf/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
Boolean.prototype.valueOf does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(Boolean.prototype.valueOf),
|
||||
false,
|
||||
'isConstructor(Boolean.prototype.valueOf) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Boolean.prototype.valueOf();
|
||||
}, '`new Boolean.prototype.valueOf()` throws TypeError');
|
||||
|
27
test/built-ins/DataView/prototype/getBigInt64/not-a-constructor.js
vendored
Normal file
27
test/built-ins/DataView/prototype/getBigInt64/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
DataView.prototype.getBigInt64 does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, BigInt, DataView, arrow-function, ArrayBuffer]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(DataView.prototype.getBigInt64),
|
||||
false,
|
||||
'isConstructor(DataView.prototype.getBigInt64) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
let dv = new DataView(new ArrayBuffer(16)); new dv.getBigInt64(0, 0);
|
||||
}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.getBigInt64(0, 0)` throws TypeError');
|
||||
|
27
test/built-ins/DataView/prototype/getBigUint64/not-a-constructor.js
vendored
Normal file
27
test/built-ins/DataView/prototype/getBigUint64/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
DataView.prototype.getBigUint64 does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, DataView, arrow-function, ArrayBuffer]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(DataView.prototype.getBigUint64),
|
||||
false,
|
||||
'isConstructor(DataView.prototype.getBigUint64) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
let dv = new DataView(new ArrayBuffer(16)); new dv.getBigUint64(0, 0);
|
||||
}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.getBigUint64(0, 0)` throws TypeError');
|
||||
|
27
test/built-ins/DataView/prototype/getFloat32/not-a-constructor.js
vendored
Normal file
27
test/built-ins/DataView/prototype/getFloat32/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
DataView.prototype.getFloat32 does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, DataView, arrow-function, ArrayBuffer]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(DataView.prototype.getFloat32),
|
||||
false,
|
||||
'isConstructor(DataView.prototype.getFloat32) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
let dv = new DataView(new ArrayBuffer(16)); new dv.getFloat32(0, 0);
|
||||
}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.getFloat32(0, 0)` throws TypeError');
|
||||
|
27
test/built-ins/DataView/prototype/getFloat64/not-a-constructor.js
vendored
Normal file
27
test/built-ins/DataView/prototype/getFloat64/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
DataView.prototype.getFloat64 does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, DataView, arrow-function, ArrayBuffer]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(DataView.prototype.getFloat64),
|
||||
false,
|
||||
'isConstructor(DataView.prototype.getFloat64) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
let dv = new DataView(new ArrayBuffer(16)); new dv.getFloat64(0, 0);
|
||||
}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.getFloat64(0, 0)` throws TypeError');
|
||||
|
27
test/built-ins/DataView/prototype/getInt16/not-a-constructor.js
vendored
Normal file
27
test/built-ins/DataView/prototype/getInt16/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
DataView.prototype.getInt16 does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, DataView, arrow-function, ArrayBuffer]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(DataView.prototype.getInt16),
|
||||
false,
|
||||
'isConstructor(DataView.prototype.getInt16) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
let dv = new DataView(new ArrayBuffer(16)); new dv.getInt16(0, 0);
|
||||
}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.getInt16(0, 0)` throws TypeError');
|
||||
|
27
test/built-ins/DataView/prototype/getInt32/not-a-constructor.js
vendored
Normal file
27
test/built-ins/DataView/prototype/getInt32/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
DataView.prototype.getInt32 does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, DataView, arrow-function, ArrayBuffer]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(DataView.prototype.getInt32),
|
||||
false,
|
||||
'isConstructor(DataView.prototype.getInt32) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
let dv = new DataView(new ArrayBuffer(16)); new dv.getInt32(0, 0);
|
||||
}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.getInt32(0, 0)` throws TypeError');
|
||||
|
27
test/built-ins/DataView/prototype/getInt8/not-a-constructor.js
vendored
Normal file
27
test/built-ins/DataView/prototype/getInt8/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
DataView.prototype.getInt8 does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, DataView, arrow-function, ArrayBuffer]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(DataView.prototype.getInt8),
|
||||
false,
|
||||
'isConstructor(DataView.prototype.getInt8) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
let dv = new DataView(new ArrayBuffer(16)); new dv.getInt8(0, 0);
|
||||
}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.getInt8(0, 0)` throws TypeError');
|
||||
|
27
test/built-ins/DataView/prototype/getUint16/not-a-constructor.js
vendored
Normal file
27
test/built-ins/DataView/prototype/getUint16/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
DataView.prototype.getUint16 does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, DataView, arrow-function, ArrayBuffer]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(DataView.prototype.getUint16),
|
||||
false,
|
||||
'isConstructor(DataView.prototype.getUint16) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
let dv = new DataView(new ArrayBuffer(16)); new dv.getUint16(0, 0);
|
||||
}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.getUint16(0, 0)` throws TypeError');
|
||||
|
27
test/built-ins/DataView/prototype/getUint32/not-a-constructor.js
vendored
Normal file
27
test/built-ins/DataView/prototype/getUint32/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
DataView.prototype.getUint32 does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, DataView, arrow-function, ArrayBuffer]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(DataView.prototype.getUint32),
|
||||
false,
|
||||
'isConstructor(DataView.prototype.getUint32) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
let dv = new DataView(new ArrayBuffer(16)); new dv.getUint32(0, 0);
|
||||
}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.getUint32(0, 0)` throws TypeError');
|
||||
|
27
test/built-ins/DataView/prototype/getUint8/not-a-constructor.js
vendored
Normal file
27
test/built-ins/DataView/prototype/getUint8/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
DataView.prototype.getUint8 does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, DataView, arrow-function, ArrayBuffer]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(DataView.prototype.getUint8),
|
||||
false,
|
||||
'isConstructor(DataView.prototype.getUint8) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
let dv = new DataView(new ArrayBuffer(16)); new dv.getUint8(0, 0);
|
||||
}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.getUint8(0, 0)` throws TypeError');
|
||||
|
27
test/built-ins/DataView/prototype/setBigInt64/not-a-constructor.js
vendored
Normal file
27
test/built-ins/DataView/prototype/setBigInt64/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
DataView.prototype.setBigInt64 does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, BigInt, DataView, arrow-function, ArrayBuffer]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(DataView.prototype.setBigInt64),
|
||||
false,
|
||||
'isConstructor(DataView.prototype.setBigInt64) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
let dv = new DataView(new ArrayBuffer(16)); new dv.setBigInt64(0, 0);
|
||||
}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.setBigInt64(0, 0)` throws TypeError');
|
||||
|
27
test/built-ins/DataView/prototype/setBigUint64/not-a-constructor.js
vendored
Normal file
27
test/built-ins/DataView/prototype/setBigUint64/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
DataView.prototype.setBigUint64 does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, DataView, arrow-function, ArrayBuffer]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(DataView.prototype.setBigUint64),
|
||||
false,
|
||||
'isConstructor(DataView.prototype.setBigUint64) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
let dv = new DataView(new ArrayBuffer(16)); new dv.setBigUint64(0, 0);
|
||||
}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.setBigUint64(0, 0)` throws TypeError');
|
||||
|
27
test/built-ins/DataView/prototype/setFloat32/not-a-constructor.js
vendored
Normal file
27
test/built-ins/DataView/prototype/setFloat32/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
DataView.prototype.setFloat32 does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, DataView, arrow-function, ArrayBuffer]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(DataView.prototype.setFloat32),
|
||||
false,
|
||||
'isConstructor(DataView.prototype.setFloat32) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
let dv = new DataView(new ArrayBuffer(16)); new dv.setFloat32(0, 0);
|
||||
}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.setFloat32(0, 0)` throws TypeError');
|
||||
|
27
test/built-ins/DataView/prototype/setFloat64/not-a-constructor.js
vendored
Normal file
27
test/built-ins/DataView/prototype/setFloat64/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
DataView.prototype.setFloat64 does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, DataView, arrow-function, ArrayBuffer]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(DataView.prototype.setFloat64),
|
||||
false,
|
||||
'isConstructor(DataView.prototype.setFloat64) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
let dv = new DataView(new ArrayBuffer(16)); new dv.setFloat64(0, 0);
|
||||
}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.setFloat64(0, 0)` throws TypeError');
|
||||
|
27
test/built-ins/DataView/prototype/setInt16/not-a-constructor.js
vendored
Normal file
27
test/built-ins/DataView/prototype/setInt16/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
DataView.prototype.setInt16 does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, DataView, arrow-function, ArrayBuffer]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(DataView.prototype.setInt16),
|
||||
false,
|
||||
'isConstructor(DataView.prototype.setInt16) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
let dv = new DataView(new ArrayBuffer(16)); new dv.setInt16(0, 0);
|
||||
}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.setInt16(0, 0)` throws TypeError');
|
||||
|
27
test/built-ins/DataView/prototype/setInt32/not-a-constructor.js
vendored
Normal file
27
test/built-ins/DataView/prototype/setInt32/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
DataView.prototype.setInt32 does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, DataView, arrow-function, ArrayBuffer]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(DataView.prototype.setInt32),
|
||||
false,
|
||||
'isConstructor(DataView.prototype.setInt32) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
let dv = new DataView(new ArrayBuffer(16)); new dv.setInt32(0, 0);
|
||||
}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.setInt32(0, 0)` throws TypeError');
|
||||
|
27
test/built-ins/DataView/prototype/setInt8/not-a-constructor.js
vendored
Normal file
27
test/built-ins/DataView/prototype/setInt8/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
DataView.prototype.setInt8 does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, DataView, arrow-function, ArrayBuffer]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(DataView.prototype.setInt8),
|
||||
false,
|
||||
'isConstructor(DataView.prototype.setInt8) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
let dv = new DataView(new ArrayBuffer(16)); new dv.setInt8(0, 0);
|
||||
}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.setInt8(0, 0)` throws TypeError');
|
||||
|
27
test/built-ins/DataView/prototype/setUint16/not-a-constructor.js
vendored
Normal file
27
test/built-ins/DataView/prototype/setUint16/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
DataView.prototype.setUint16 does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, DataView, arrow-function, ArrayBuffer]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(DataView.prototype.setUint16),
|
||||
false,
|
||||
'isConstructor(DataView.prototype.setUint16) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
let dv = new DataView(new ArrayBuffer(16)); new dv.setUint16(0, 0);
|
||||
}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.setUint16(0, 0)` throws TypeError');
|
||||
|
27
test/built-ins/DataView/prototype/setUint32/not-a-constructor.js
vendored
Normal file
27
test/built-ins/DataView/prototype/setUint32/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
DataView.prototype.setUint32 does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, DataView, arrow-function, ArrayBuffer]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(DataView.prototype.setUint32),
|
||||
false,
|
||||
'isConstructor(DataView.prototype.setUint32) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
let dv = new DataView(new ArrayBuffer(16)); new dv.setUint32(0, 0);
|
||||
}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.setUint32(0, 0)` throws TypeError');
|
||||
|
27
test/built-ins/DataView/prototype/setUint8/not-a-constructor.js
vendored
Normal file
27
test/built-ins/DataView/prototype/setUint8/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
DataView.prototype.setUint8 does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, DataView, arrow-function, ArrayBuffer]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(DataView.prototype.setUint8),
|
||||
false,
|
||||
'isConstructor(DataView.prototype.setUint8) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
let dv = new DataView(new ArrayBuffer(16)); new dv.setUint8(0, 0);
|
||||
}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.setUint8(0, 0)` throws TypeError');
|
||||
|
23
test/built-ins/Date/UTC/not-a-constructor.js
Normal file
23
test/built-ins/Date/UTC/not-a-constructor.js
Normal file
@ -0,0 +1,23 @@
|
||||
// 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: >
|
||||
Date.UTC does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(isConstructor(Date.UTC), false, 'isConstructor(Date.UTC) must return false');
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Date.UTC();
|
||||
}, '`new Date.UTC()` throws TypeError');
|
||||
|
23
test/built-ins/Date/now/not-a-constructor.js
Normal file
23
test/built-ins/Date/now/not-a-constructor.js
Normal file
@ -0,0 +1,23 @@
|
||||
// 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: >
|
||||
Date.now does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(isConstructor(Date.now), false, 'isConstructor(Date.now) must return false');
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Date.now();
|
||||
}, '`new Date.now()` throws TypeError');
|
||||
|
23
test/built-ins/Date/parse/not-a-constructor.js
Normal file
23
test/built-ins/Date/parse/not-a-constructor.js
Normal file
@ -0,0 +1,23 @@
|
||||
// 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: >
|
||||
Date.parse does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(isConstructor(Date.parse), false, 'isConstructor(Date.parse) must return false');
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
new Date.parse();
|
||||
}, '`new Date.parse()` throws TypeError');
|
||||
|
27
test/built-ins/Date/prototype/getDate/not-a-constructor.js
vendored
Normal file
27
test/built-ins/Date/prototype/getDate/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
Date.prototype.getDate does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(Date.prototype.getDate),
|
||||
false,
|
||||
'isConstructor(Date.prototype.getDate) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
let date = new Date(Date.now()); new date.getDate();
|
||||
}, '`let date = new Date(Date.now()); new date.getDate()` throws TypeError');
|
||||
|
27
test/built-ins/Date/prototype/getDay/not-a-constructor.js
vendored
Normal file
27
test/built-ins/Date/prototype/getDay/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
Date.prototype.getDay does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(Date.prototype.getDay),
|
||||
false,
|
||||
'isConstructor(Date.prototype.getDay) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
let date = new Date(Date.now()); new date.getDay();
|
||||
}, '`let date = new Date(Date.now()); new date.getDay()` throws TypeError');
|
||||
|
27
test/built-ins/Date/prototype/getFullYear/not-a-constructor.js
vendored
Normal file
27
test/built-ins/Date/prototype/getFullYear/not-a-constructor.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: >
|
||||
Date.prototype.getFullYear does not implement [[Construct]]
|
||||
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.
|
||||
includes: [isConstructor.js]
|
||||
features: [Reflect.construct, arrow-function]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
isConstructor(Date.prototype.getFullYear),
|
||||
false,
|
||||
'isConstructor(Date.prototype.getFullYear) must return false'
|
||||
);
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
let date = new Date(Date.now()); new date.getFullYear();
|
||||
}, '`let date = new Date(Date.now()); new date.getFullYear()` throws TypeError');
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user