From cbd69bd26f1099b1cec75d4225a876e0f1c710e8 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Mon, 19 Jul 2021 22:49:41 -0400 Subject: [PATCH] Improve coverage for Error.prototype.name Extend coverage to include the property's writability and configurability. Use the conventional `verifyProperty` harness function to consolidate tests. --- .../Error/prototype/name/15.11.4.2-1.js | 11 ----------- .../Error/prototype/name/S15.11.4.2_A1.js | 16 ---------------- .../Error/prototype/name/S15.11.4.2_A2.js | 16 ---------------- test/built-ins/Error/prototype/name/prop-desc.js | 14 ++++++++++++++ 4 files changed, 14 insertions(+), 43 deletions(-) delete mode 100644 test/built-ins/Error/prototype/name/15.11.4.2-1.js delete mode 100644 test/built-ins/Error/prototype/name/S15.11.4.2_A1.js delete mode 100644 test/built-ins/Error/prototype/name/S15.11.4.2_A2.js create mode 100644 test/built-ins/Error/prototype/name/prop-desc.js diff --git a/test/built-ins/Error/prototype/name/15.11.4.2-1.js b/test/built-ins/Error/prototype/name/15.11.4.2-1.js deleted file mode 100644 index de519ef06d..0000000000 --- a/test/built-ins/Error/prototype/name/15.11.4.2-1.js +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.11.4.2-1 -description: Error.prototype.name is not enumerable. ----*/ - -for (var i in Error.prototype) { - assert.notSameValue(i, "name", 'i'); -} diff --git a/test/built-ins/Error/prototype/name/S15.11.4.2_A1.js b/test/built-ins/Error/prototype/name/S15.11.4.2_A1.js deleted file mode 100644 index 392c8842c1..0000000000 --- a/test/built-ins/Error/prototype/name/S15.11.4.2_A1.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: The Error.prototype has name property -es5id: 15.11.4.2_A1 -description: Checking Error.prototype.name ----*/ - -////////////////////////////////////////////////////////////////////////////// -// CHECK#1 -if (!Error.prototype.hasOwnProperty('name')) { - throw new Test262Error('#1: Error.prototype.hasOwnProperty(\'name\') return true. Actual: ' + Error.prototype.hasOwnProperty('name')); -} -// -////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/Error/prototype/name/S15.11.4.2_A2.js b/test/built-ins/Error/prototype/name/S15.11.4.2_A2.js deleted file mode 100644 index 20dec638d0..0000000000 --- a/test/built-ins/Error/prototype/name/S15.11.4.2_A2.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: The initial value of Error.prototype.name is "Error" -es5id: 15.11.4.2_A2 -description: Checking value of Error.prototype.name ----*/ - -////////////////////////////////////////////////////////////////////////////// -// CHECK#1 -if (Error.prototype.name !== "Error") { - throw new Test262Error('#1: Error.prototype.name==="Error". Actual: ' + Error.prototype.name); -} -// -////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/Error/prototype/name/prop-desc.js b/test/built-ins/Error/prototype/name/prop-desc.js new file mode 100644 index 0000000000..1c24018517 --- /dev/null +++ b/test/built-ins/Error/prototype/name/prop-desc.js @@ -0,0 +1,14 @@ +// Copyright (c) 2021 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-error.prototype.name +description: Property descriptor of Error.prototype.name +includes: [propertyHelper.js] +---*/ + +verifyProperty(Error.prototype, 'name', { + enumerable: false, + writable: true, + configurable: true, + value: 'Error' +});