From c138c2acbe4126703ed1870d41a7ea360c8369e6 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Mon, 19 Jul 2021 22:43:37 -0400 Subject: [PATCH] Improve coverage for Error.prototype.message Extend coverage to include the property's writability, configurability, and value. Use the conventional `verifyProperty` harness function to consolidate tests. --- .../Error/prototype/message/15.11.4.3-1.js | 11 ----------- .../Error/prototype/message/S15.11.4.3_A1.js | 16 ---------------- .../Error/prototype/message/S15.11.4.3_A2.js | 16 ---------------- .../Error/prototype/message/prop-desc.js | 14 ++++++++++++++ 4 files changed, 14 insertions(+), 43 deletions(-) delete mode 100644 test/built-ins/Error/prototype/message/15.11.4.3-1.js delete mode 100644 test/built-ins/Error/prototype/message/S15.11.4.3_A1.js delete mode 100644 test/built-ins/Error/prototype/message/S15.11.4.3_A2.js create mode 100644 test/built-ins/Error/prototype/message/prop-desc.js diff --git a/test/built-ins/Error/prototype/message/15.11.4.3-1.js b/test/built-ins/Error/prototype/message/15.11.4.3-1.js deleted file mode 100644 index 303078ba80..0000000000 --- a/test/built-ins/Error/prototype/message/15.11.4.3-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.3-1 -description: Error.prototype.message is not enumerable. ----*/ - -for (var i in Error.prototype) { - assert.notSameValue(i, "message", 'i'); -} diff --git a/test/built-ins/Error/prototype/message/S15.11.4.3_A1.js b/test/built-ins/Error/prototype/message/S15.11.4.3_A1.js deleted file mode 100644 index c2a4dcdbf6..0000000000 --- a/test/built-ins/Error/prototype/message/S15.11.4.3_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 message property -es5id: 15.11.4.3_A1 -description: Checking Error.prototype.message ----*/ - -////////////////////////////////////////////////////////////////////////////// -// CHECK#1 -if (!Error.prototype.hasOwnProperty('message')) { - throw new Test262Error('#1: Error.prototype.hasOwnProperty(\'message\') reurn true. Actual: ' + Error.prototype.hasOwnProperty('message')); -} -// -////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/Error/prototype/message/S15.11.4.3_A2.js b/test/built-ins/Error/prototype/message/S15.11.4.3_A2.js deleted file mode 100644 index 7f44432f60..0000000000 --- a/test/built-ins/Error/prototype/message/S15.11.4.3_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.message is "" -es5id: 15.11.4.3_A2 -description: Checking value of Error.prototype.message ----*/ - -////////////////////////////////////////////////////////////////////////////// -// CHECK#1 -if (typeof Error.prototype.message !== "string") { - throw new Test262Error('#1: typeof Error.prototype.message === "string". Actual: ' + Error.prototype.message); -} -// -////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/Error/prototype/message/prop-desc.js b/test/built-ins/Error/prototype/message/prop-desc.js new file mode 100644 index 0000000000..dbab0e81e6 --- /dev/null +++ b/test/built-ins/Error/prototype/message/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.message +description: Property descriptor of Error.prototype.message +includes: [propertyHelper.js] +---*/ + +verifyProperty(Error.prototype, 'message', { + enumerable: false, + writable: true, + configurable: true, + value: '' +});