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.
This commit is contained in:
Mike Pennisi 2021-07-19 22:49:41 -04:00 committed by Rick Waldron
parent c138c2acbe
commit cbd69bd26f
4 changed files with 14 additions and 43 deletions

View File

@ -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');
}

View File

@ -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'));
}
//
//////////////////////////////////////////////////////////////////////////////

View File

@ -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);
}
//
//////////////////////////////////////////////////////////////////////////////

View File

@ -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'
});