mirror of
https://github.com/tc39/test262.git
synced 2025-07-25 23:14:47 +02:00
Deprecate some property helpers
Document the preference for `verifyProperty` over the various other property-related helper functions.
This commit is contained in:
parent
5eb7dfbced
commit
276e79d62e
@ -6,13 +6,13 @@ description: |
|
|||||||
property descriptors.
|
property descriptors.
|
||||||
defines:
|
defines:
|
||||||
- verifyProperty
|
- verifyProperty
|
||||||
- verifyEqualTo
|
- verifyEqualTo # deprecated
|
||||||
- verifyWritable
|
- verifyWritable # deprecated
|
||||||
- verifyNotWritable
|
- verifyNotWritable # deprecated
|
||||||
- verifyEnumerable
|
- verifyEnumerable # deprecated
|
||||||
- verifyNotEnumerable
|
- verifyNotEnumerable # deprecated
|
||||||
- verifyConfigurable
|
- verifyConfigurable # deprecated
|
||||||
- verifyNotConfigurable
|
- verifyNotConfigurable # deprecated
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
// @ts-check
|
// @ts-check
|
||||||
@ -173,6 +173,9 @@ function isWritable(obj, name, verifyProp, value) {
|
|||||||
return writeSucceeded;
|
return writeSucceeded;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deprecated; please use `verifyProperty` in new tests.
|
||||||
|
*/
|
||||||
function verifyEqualTo(obj, name, value) {
|
function verifyEqualTo(obj, name, value) {
|
||||||
if (!isSameValue(obj[name], value)) {
|
if (!isSameValue(obj[name], value)) {
|
||||||
throw new Test262Error("Expected obj[" + String(name) + "] to equal " + value +
|
throw new Test262Error("Expected obj[" + String(name) + "] to equal " + value +
|
||||||
@ -180,6 +183,9 @@ function verifyEqualTo(obj, name, value) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deprecated; please use `verifyProperty` in new tests.
|
||||||
|
*/
|
||||||
function verifyWritable(obj, name, verifyProp, value) {
|
function verifyWritable(obj, name, verifyProp, value) {
|
||||||
if (!verifyProp) {
|
if (!verifyProp) {
|
||||||
assert(Object.getOwnPropertyDescriptor(obj, name).writable,
|
assert(Object.getOwnPropertyDescriptor(obj, name).writable,
|
||||||
@ -190,6 +196,9 @@ function verifyWritable(obj, name, verifyProp, value) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deprecated; please use `verifyProperty` in new tests.
|
||||||
|
*/
|
||||||
function verifyNotWritable(obj, name, verifyProp, value) {
|
function verifyNotWritable(obj, name, verifyProp, value) {
|
||||||
if (!verifyProp) {
|
if (!verifyProp) {
|
||||||
assert(!Object.getOwnPropertyDescriptor(obj, name).writable,
|
assert(!Object.getOwnPropertyDescriptor(obj, name).writable,
|
||||||
@ -200,6 +209,9 @@ function verifyNotWritable(obj, name, verifyProp, value) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deprecated; please use `verifyProperty` in new tests.
|
||||||
|
*/
|
||||||
function verifyEnumerable(obj, name) {
|
function verifyEnumerable(obj, name) {
|
||||||
assert(Object.getOwnPropertyDescriptor(obj, name).enumerable,
|
assert(Object.getOwnPropertyDescriptor(obj, name).enumerable,
|
||||||
"Expected obj[" + String(name) + "] to have enumerable:true.");
|
"Expected obj[" + String(name) + "] to have enumerable:true.");
|
||||||
@ -208,6 +220,9 @@ function verifyEnumerable(obj, name) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deprecated; please use `verifyProperty` in new tests.
|
||||||
|
*/
|
||||||
function verifyNotEnumerable(obj, name) {
|
function verifyNotEnumerable(obj, name) {
|
||||||
assert(!Object.getOwnPropertyDescriptor(obj, name).enumerable,
|
assert(!Object.getOwnPropertyDescriptor(obj, name).enumerable,
|
||||||
"Expected obj[" + String(name) + "] to have enumerable:false.");
|
"Expected obj[" + String(name) + "] to have enumerable:false.");
|
||||||
@ -216,6 +231,9 @@ function verifyNotEnumerable(obj, name) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deprecated; please use `verifyProperty` in new tests.
|
||||||
|
*/
|
||||||
function verifyConfigurable(obj, name) {
|
function verifyConfigurable(obj, name) {
|
||||||
assert(Object.getOwnPropertyDescriptor(obj, name).configurable,
|
assert(Object.getOwnPropertyDescriptor(obj, name).configurable,
|
||||||
"Expected obj[" + String(name) + "] to have configurable:true.");
|
"Expected obj[" + String(name) + "] to have configurable:true.");
|
||||||
@ -224,6 +242,9 @@ function verifyConfigurable(obj, name) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deprecated; please use `verifyProperty` in new tests.
|
||||||
|
*/
|
||||||
function verifyNotConfigurable(obj, name) {
|
function verifyNotConfigurable(obj, name) {
|
||||||
assert(!Object.getOwnPropertyDescriptor(obj, name).configurable,
|
assert(!Object.getOwnPropertyDescriptor(obj, name).configurable,
|
||||||
"Expected obj[" + String(name) + "] to have configurable:false.");
|
"Expected obj[" + String(name) + "] to have configurable:false.");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user