From 6d5975defcc34356e7674caf12eb00761053a4ff Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Fri, 10 Dec 2021 13:56:02 -0500 Subject: [PATCH] Remove duplicated constructor tests A number of tests were found to be duplicative based on an analysis of file contents (included below). Eliminate the duplication by removing the version of each test with less precise metadata. In cases where this removal could technically be considered a reduction in coverage, preserve the verification of additional semantics in the remaining test. $ git grep -El 'new\s+\w+.prototype' | sed 's/[^\/]\+$//g' | sort | uniq -c | grep -vE '^\s+1 ' | awk '{print $2}' | xargs grep -Elr 'new\s+\w+.prototype' test/built-ins/Array/prototype/join/S15.4.4.5_A6.7.js test/built-ins/Array/prototype/join/not-a-constructor.js test/built-ins/Array/prototype/pop/not-a-constructor.js test/built-ins/Array/prototype/pop/S15.4.4.6_A5.7.js test/built-ins/Array/prototype/push/S15.4.4.7_A6.7.js test/built-ins/Array/prototype/push/not-a-constructor.js test/built-ins/Array/prototype/shift/not-a-constructor.js test/built-ins/Array/prototype/shift/S15.4.4.9_A5.7.js test/built-ins/Array/prototype/slice/not-a-constructor.js test/built-ins/Array/prototype/slice/S15.4.4.10_A5.7.js test/built-ins/Array/prototype/sort/not-a-constructor.js test/built-ins/Array/prototype/sort/S15.4.4.11_A7.7.js test/built-ins/Array/prototype/splice/S15.4.4.12_A5.7.js test/built-ins/Array/prototype/splice/not-a-constructor.js test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.7.js test/built-ins/Array/prototype/toLocaleString/not-a-constructor.js test/built-ins/Array/prototype/toString/S15.4.4.2_A4.7.js test/built-ins/Array/prototype/toString/not-a-constructor.js test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.7.js test/built-ins/Array/prototype/unshift/not-a-constructor.js test/built-ins/Function/prototype/apply/S15.3.4.3_A8_T1.js test/built-ins/Function/prototype/apply/S15.3.4.3_A8_T2.js test/built-ins/Function/prototype/apply/not-a-constructor.js test/built-ins/Function/prototype/call/not-a-constructor.js test/built-ins/Function/prototype/call/S15.3.4.4_A7_T2.js test/built-ins/Function/prototype/call/S15.3.4.4_A7_T1.js test/built-ins/Function/prototype/toString/S15.3.4.2_A7.js test/built-ins/Function/prototype/toString/not-a-constructor.js test/built-ins/Object/prototype/hasOwnProperty/S15.2.4.5_A7.js test/built-ins/Object/prototype/hasOwnProperty/not-a-constructor.js test/built-ins/Object/prototype/propertyIsEnumerable/not-a-constructor.js test/built-ins/Object/prototype/propertyIsEnumerable/S15.2.4.7_A7.js test/built-ins/Object/prototype/toLocaleString/S15.2.4.3_A7.js test/built-ins/Object/prototype/toLocaleString/not-a-constructor.js test/built-ins/Object/prototype/toString/not-a-constructor.js test/built-ins/Object/prototype/toString/not-ctor.js test/built-ins/Object/prototype/valueOf/not-a-constructor.js test/built-ins/Object/prototype/valueOf/S15.2.4.4_A7.js --- .../Array/prototype/join/S15.4.4.5_A6.7.js | 14 -------------- .../Array/prototype/pop/S15.4.4.6_A5.7.js | 14 -------------- .../Array/prototype/push/S15.4.4.7_A6.7.js | 14 -------------- .../Array/prototype/shift/S15.4.4.9_A5.7.js | 14 -------------- .../Array/prototype/slice/S15.4.4.10_A5.7.js | 14 -------------- .../Array/prototype/sort/S15.4.4.11_A7.7.js | 14 -------------- .../Array/prototype/splice/S15.4.4.12_A5.7.js | 14 -------------- .../prototype/toLocaleString/S15.4.4.3_A4.7.js | 15 --------------- .../Array/prototype/toString/S15.4.4.2_A4.7.js | 15 --------------- .../Array/prototype/unshift/S15.4.4.13_A5.7.js | 14 -------------- .../Function/prototype/apply/S15.3.4.3_A8_T1.js | 15 --------------- .../Function/prototype/apply/S15.3.4.3_A8_T2.js | 15 --------------- .../prototype/apply/not-a-constructor.js | 5 ++++- .../Function/prototype/call/S15.3.4.4_A7_T1.js | 15 --------------- .../Function/prototype/call/S15.3.4.4_A7_T2.js | 16 ---------------- .../Function/prototype/call/not-a-constructor.js | 8 ++++++++ .../Function/prototype/toString/S15.3.4.2_A7.js | 14 -------------- .../prototype/toString/not-a-constructor.js | 4 ++++ .../prototype/hasOwnProperty/S15.2.4.5_A7.js | 12 ------------ .../propertyIsEnumerable/S15.2.4.7_A7.js | 14 -------------- .../prototype/toLocaleString/S15.2.4.3_A7.js | 12 ------------ .../Object/prototype/toString/not-ctor.js | 15 --------------- .../Object/prototype/valueOf/S15.2.4.4_A7.js | 12 ------------ 23 files changed, 16 insertions(+), 283 deletions(-) delete mode 100644 test/built-ins/Array/prototype/join/S15.4.4.5_A6.7.js delete mode 100644 test/built-ins/Array/prototype/pop/S15.4.4.6_A5.7.js delete mode 100644 test/built-ins/Array/prototype/push/S15.4.4.7_A6.7.js delete mode 100644 test/built-ins/Array/prototype/shift/S15.4.4.9_A5.7.js delete mode 100644 test/built-ins/Array/prototype/slice/S15.4.4.10_A5.7.js delete mode 100644 test/built-ins/Array/prototype/sort/S15.4.4.11_A7.7.js delete mode 100644 test/built-ins/Array/prototype/splice/S15.4.4.12_A5.7.js delete mode 100644 test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.7.js delete mode 100644 test/built-ins/Array/prototype/toString/S15.4.4.2_A4.7.js delete mode 100644 test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.7.js delete mode 100644 test/built-ins/Function/prototype/apply/S15.3.4.3_A8_T1.js delete mode 100644 test/built-ins/Function/prototype/apply/S15.3.4.3_A8_T2.js delete mode 100644 test/built-ins/Function/prototype/call/S15.3.4.4_A7_T1.js delete mode 100644 test/built-ins/Function/prototype/call/S15.3.4.4_A7_T2.js delete mode 100644 test/built-ins/Function/prototype/toString/S15.3.4.2_A7.js delete mode 100644 test/built-ins/Object/prototype/hasOwnProperty/S15.2.4.5_A7.js delete mode 100644 test/built-ins/Object/prototype/propertyIsEnumerable/S15.2.4.7_A7.js delete mode 100644 test/built-ins/Object/prototype/toLocaleString/S15.2.4.3_A7.js delete mode 100644 test/built-ins/Object/prototype/toString/not-ctor.js delete mode 100644 test/built-ins/Object/prototype/valueOf/S15.2.4.4_A7.js diff --git a/test/built-ins/Array/prototype/join/S15.4.4.5_A6.7.js b/test/built-ins/Array/prototype/join/S15.4.4.5_A6.7.js deleted file mode 100644 index 767e175018..0000000000 --- a/test/built-ins/Array/prototype/join/S15.4.4.5_A6.7.js +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The join property of Array can't be used as constructor -esid: sec-array.prototype.join -description: > - If property does not implement the internal [[Construct]] method, - throw a TypeError exception ----*/ - -assert.throws(TypeError, () => { - new Array.prototype.join(); -}); diff --git a/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.7.js b/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.7.js deleted file mode 100644 index 83baf39ffe..0000000000 --- a/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.7.js +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The pop property of Array can't be used as constructor -esid: sec-array.prototype.pop -description: > - If property does not implement the internal [[Construct]] method, - throw a TypeError exception ----*/ - -assert.throws(TypeError, () => { - new Array.prototype.pop(); -}); diff --git a/test/built-ins/Array/prototype/push/S15.4.4.7_A6.7.js b/test/built-ins/Array/prototype/push/S15.4.4.7_A6.7.js deleted file mode 100644 index 12edbf0216..0000000000 --- a/test/built-ins/Array/prototype/push/S15.4.4.7_A6.7.js +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The push property of Array can't be used as constructor -esid: sec-array.prototype.push -description: > - If property does not implement the internal [[Construct]] method, - throw a TypeError exception ----*/ - -assert.throws(TypeError, () => { - new Array.prototype.push(); -}); diff --git a/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.7.js b/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.7.js deleted file mode 100644 index 98dd6ebc87..0000000000 --- a/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.7.js +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The shift property of Array can't be used as constructor -esid: sec-array.prototype.shift -description: > - If property does not implement the internal [[Construct]] method, - throw a TypeError exception ----*/ - -assert.throws(TypeError, () => { - new Array.prototype.shift(); -}); diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.7.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.7.js deleted file mode 100644 index 0a14eba0b8..0000000000 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.7.js +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The slice property of Array can't be used as constructor -esid: sec-array.prototype.slice -description: > - If property does not implement the internal [[Construct]] method, - throw a TypeError exception ----*/ - -assert.throws(TypeError, () => { - new Array.prototype.slice(); -}); diff --git a/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.7.js b/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.7.js deleted file mode 100644 index e13237a187..0000000000 --- a/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.7.js +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The sort property of Array can't be used as constructor -esid: sec-array.prototype.sort -description: > - If property does not implement the internal [[Construct]] method, - throw a TypeError exception ----*/ - -assert.throws(TypeError, () => { - new Array.prototype.sort(); -}); diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.7.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.7.js deleted file mode 100644 index 32036bef4a..0000000000 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.7.js +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The splice property of Array can't be used as constructor -esid: sec-array.prototype.splice -description: > - If property does not implement the internal [[Construct]] method, - throw a TypeError exception ----*/ - -assert.throws(TypeError, () => { - new Array.prototype.splice(); -}); diff --git a/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.7.js b/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.7.js deleted file mode 100644 index b3bfe1018b..0000000000 --- a/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.7.js +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-array.prototype.tolocalestring -info: The toLocaleString property of Array can't be used as constructor -es5id: 15.4.4.3_A4.7 -description: > - If property does not implement the internal [[Construct]] method, - throw a TypeError exception ----*/ - -assert.throws(TypeError, () => { - new Array.prototype.toLocaleString(); -}); diff --git a/test/built-ins/Array/prototype/toString/S15.4.4.2_A4.7.js b/test/built-ins/Array/prototype/toString/S15.4.4.2_A4.7.js deleted file mode 100644 index 0ab0b23d7c..0000000000 --- a/test/built-ins/Array/prototype/toString/S15.4.4.2_A4.7.js +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-array.prototype.tostring -info: The toString property of Array can't be used as constructor -es5id: 15.4.4.2_A4.7 -description: > - If property does not implement the internal [[Construct]] method, - throw a TypeError exception ----*/ - -assert.throws(TypeError, () => { - new Array.prototype.toString(); -}); diff --git a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.7.js b/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.7.js deleted file mode 100644 index ac87872375..0000000000 --- a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.7.js +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The unshift property of Array can't be used as constructor -esid: sec-array.prototype.unshift -description: > - If property does not implement the internal [[Construct]] method, - throw a TypeError exception ----*/ - -assert.throws(TypeError, () => { - new Array.prototype.unshift(); -}); diff --git a/test/built-ins/Function/prototype/apply/S15.3.4.3_A8_T1.js b/test/built-ins/Function/prototype/apply/S15.3.4.3_A8_T1.js deleted file mode 100644 index dbce6ab382..0000000000 --- a/test/built-ins/Function/prototype/apply/S15.3.4.3_A8_T1.js +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: Function.prototype.apply can`t be used as [[Construct]] caller -es5id: 15.3.4.3_A8_T1 -description: Checking if creating "new Function.prototype.apply" fails ----*/ - -try { - var obj = new Function.prototype.apply; - throw new Test262Error('#1: Function.prototype.apply can\'t be used as [[Construct]] caller'); -} catch (e) { - assert(e instanceof TypeError, 'The result of evaluating (e instanceof TypeError) is expected to be true'); -} diff --git a/test/built-ins/Function/prototype/apply/S15.3.4.3_A8_T2.js b/test/built-ins/Function/prototype/apply/S15.3.4.3_A8_T2.js deleted file mode 100644 index 3ece142981..0000000000 --- a/test/built-ins/Function/prototype/apply/S15.3.4.3_A8_T2.js +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: Function.prototype.apply can`t be used as [[Construct]] caller -es5id: 15.3.4.3_A8_T2 -description: Checking if creating "new Function.prototype.apply()" fails ----*/ - -try { - var obj = new Function.prototype.apply(); - throw new Test262Error('#1: Function.prototype.apply can\'t be used as [[Construct]] caller'); -} catch (e) { - assert(e instanceof TypeError, 'The result of evaluating (e instanceof TypeError) is expected to be true'); -} diff --git a/test/built-ins/Function/prototype/apply/not-a-constructor.js b/test/built-ins/Function/prototype/apply/not-a-constructor.js index 5aba8c562d..c808b02011 100644 --- a/test/built-ins/Function/prototype/apply/not-a-constructor.js +++ b/test/built-ins/Function/prototype/apply/not-a-constructor.js @@ -27,7 +27,10 @@ assert.sameValue( 'isConstructor(Function.prototype.apply) must return false' ); +assert.throws(TypeError, () => { + new Function.prototype.apply; +}, '`new Function.prototype.apply` throws TypeError'); + assert.throws(TypeError, () => { new Function.prototype.apply(); }, '`new Function.prototype.apply()` throws TypeError'); - diff --git a/test/built-ins/Function/prototype/call/S15.3.4.4_A7_T1.js b/test/built-ins/Function/prototype/call/S15.3.4.4_A7_T1.js deleted file mode 100644 index 9b85847381..0000000000 --- a/test/built-ins/Function/prototype/call/S15.3.4.4_A7_T1.js +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: Function.prototype.call can't be used as [[Construct]] caller -es5id: 15.3.4.4_A7_T1 -description: Checking if creating "new Function.prototype.call" fails ----*/ - -try { - var obj = new Function.prototype.call; - throw new Test262Error('#1: Function.prototype.call can\'t be used as [[Construct]] caller'); -} catch (e) { - assert(e instanceof TypeError, 'The result of evaluating (e instanceof TypeError) is expected to be true'); -} diff --git a/test/built-ins/Function/prototype/call/S15.3.4.4_A7_T2.js b/test/built-ins/Function/prototype/call/S15.3.4.4_A7_T2.js deleted file mode 100644 index b530af9215..0000000000 --- a/test/built-ins/Function/prototype/call/S15.3.4.4_A7_T2.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: Function.prototype.call can't be used as [[Construct]] caller -es5id: 15.3.4.4_A7_T2 -description: Checking if creating "new Function.prototype.call()" fails ----*/ - -try { - var FACTORY = Function.prototype.call; - var obj = new FACTORY(); - throw new Test262Error('#1: Function.prototype.call can\'t be used as [[Construct]] caller'); -} catch (e) { - assert(e instanceof TypeError, 'The result of evaluating (e instanceof TypeError) is expected to be true'); -} diff --git a/test/built-ins/Function/prototype/call/not-a-constructor.js b/test/built-ins/Function/prototype/call/not-a-constructor.js index acf5ea09da..34260535bd 100644 --- a/test/built-ins/Function/prototype/call/not-a-constructor.js +++ b/test/built-ins/Function/prototype/call/not-a-constructor.js @@ -31,3 +31,11 @@ assert.throws(TypeError, () => { new Function.prototype.call(); }, '`new Function.prototype.call()` throws TypeError'); +assert.throws(TypeError, () => { + new Function.prototype.call; +}, '`new Function.prototype.call` throws TypeError'); + +var call = Function.prototype.call; +assert.throws(TypeError, () => { + new call; +}, '`new call()` throws TypeError'); diff --git a/test/built-ins/Function/prototype/toString/S15.3.4.2_A7.js b/test/built-ins/Function/prototype/toString/S15.3.4.2_A7.js deleted file mode 100644 index fabab25bd0..0000000000 --- a/test/built-ins/Function/prototype/toString/S15.3.4.2_A7.js +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: Function.prototype.toString can't be used as constructor -es5id: 15.3.4.2_A7 -description: Checking if creating "new Function.prototype.toString" fails ----*/ - -var FACTORY = Function.prototype.toString; - -assert.throws(TypeError, function() { - new FACTORY; -}, '`new FACTORY` throws a TypeError exception'); diff --git a/test/built-ins/Function/prototype/toString/not-a-constructor.js b/test/built-ins/Function/prototype/toString/not-a-constructor.js index 695d09e85b..e5725c3328 100644 --- a/test/built-ins/Function/prototype/toString/not-a-constructor.js +++ b/test/built-ins/Function/prototype/toString/not-a-constructor.js @@ -31,3 +31,7 @@ assert.throws(TypeError, () => { new Function.prototype.toString(); }, '`new Function.prototype.toString()` throws TypeError'); +var toString = Function.prototype.toString; +assert.throws(TypeError, () => { + new toString; +}, '`new toString` throws TypeError'); diff --git a/test/built-ins/Object/prototype/hasOwnProperty/S15.2.4.5_A7.js b/test/built-ins/Object/prototype/hasOwnProperty/S15.2.4.5_A7.js deleted file mode 100644 index bffb92c10f..0000000000 --- a/test/built-ins/Object/prototype/hasOwnProperty/S15.2.4.5_A7.js +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: Object.prototype.hasOwnProperty can't be used as a constructor -es5id: 15.2.4.5_A7 -description: Checking if creating "new Object.prototype.hasOwnProperty" fails ----*/ - -assert.throws(TypeError, function() { - new Object.prototype.hasOwnProperty(); -}, '`new Object.prototype.hasOwnProperty()` throws a TypeError exception'); diff --git a/test/built-ins/Object/prototype/propertyIsEnumerable/S15.2.4.7_A7.js b/test/built-ins/Object/prototype/propertyIsEnumerable/S15.2.4.7_A7.js deleted file mode 100644 index b909f57748..0000000000 --- a/test/built-ins/Object/prototype/propertyIsEnumerable/S15.2.4.7_A7.js +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: Object.prototype.propertyIsEnumerable can't be used as a constructor -es5id: 15.2.4.7_A7 -description: > - Checking if creating "new Object.prototype.propertyIsEnumerable" - fails ----*/ - -assert.throws(TypeError, function() { - new Object.prototype.propertyIsEnumerable(); -}, '`new Object.prototype.propertyIsEnumerable()` throws a TypeError exception'); diff --git a/test/built-ins/Object/prototype/toLocaleString/S15.2.4.3_A7.js b/test/built-ins/Object/prototype/toLocaleString/S15.2.4.3_A7.js deleted file mode 100644 index 1a8a4a3e2d..0000000000 --- a/test/built-ins/Object/prototype/toLocaleString/S15.2.4.3_A7.js +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: Object.prototype.toLocaleString can't be used as a constructor -es5id: 15.2.4.3_A7 -description: Checking if creating "new Object.prototype.toLocaleString" fails ----*/ - -assert.throws(TypeError, function() { - new Object.prototype.toLocaleString(); -}, '`new Object.prototype.toLocaleString()` throws a TypeError exception'); diff --git a/test/built-ins/Object/prototype/toString/not-ctor.js b/test/built-ins/Object/prototype/toString/not-ctor.js deleted file mode 100644 index 149ada629e..0000000000 --- a/test/built-ins/Object/prototype/toString/not-ctor.js +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-ecmascript-standard-built-in-objects -description: Object.prototype.toString is not a constructor -info: | - Built-in function objects that are not identified as constructors do - not implement the [[Construct]] internal method unless otherwise specified - in the description of a particular function ----*/ - -assert.throws(TypeError, function() { - new Object.prototype.toString(); -}); diff --git a/test/built-ins/Object/prototype/valueOf/S15.2.4.4_A7.js b/test/built-ins/Object/prototype/valueOf/S15.2.4.4_A7.js deleted file mode 100644 index f8744b6aef..0000000000 --- a/test/built-ins/Object/prototype/valueOf/S15.2.4.4_A7.js +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: Object.prototype.valueOf can't be used as a constructor -es5id: 15.2.4.4_A7 -description: Checking if creating "new Object.prototype.valueOf" fails ----*/ - -assert.throws(TypeError, function() { - new Object.prototype.valueOf(); -}, '`new Object.prototype.valueOf()` throws a TypeError exception');