mirror of https://github.com/tc39/test262.git
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:
parent
c138c2acbe
commit
cbd69bd26f
|
@ -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');
|
||||
}
|
|
@ -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'));
|
||||
}
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
|
@ -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);
|
||||
}
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
|
@ -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'
|
||||
});
|
Loading…
Reference in New Issue