зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1503596 [wpt PR 13813] - Add assert_not_own_property, a=testonly
Automatic update from web-platform-testsAdd assert_not_own_property (#13813) Fixed #13186 -- wpt-commits: 679a364421ce3704289df21e1ff985c14b360981 wpt-pr: 13813
This commit is contained in:
Родитель
ecc57e79a3
Коммит
883d572800
|
@ -758,6 +758,9 @@ asserts that the class string of `object` as returned in
|
|||
### `assert_own_property(object, property_name, description)`
|
||||
assert that object has own property `property_name`
|
||||
|
||||
### `assert_not_own_property(object, property_name, description)`
|
||||
assert that object does not have an own property named `property_name`
|
||||
|
||||
### `assert_inherits(object, property_name, description)`
|
||||
assert that object does not have an own property named
|
||||
`property_name` but that `property_name` is present in the prototype
|
||||
|
|
|
@ -148,10 +148,10 @@
|
|||
A.prototype = {b:"b"}
|
||||
var a = new A();
|
||||
assert_own_property(a, "a");
|
||||
assert_false(a.hasOwnProperty("b"), "unexpected property found: \"b\"");
|
||||
assert_not_own_property(a, "b", "unexpected property found: \"b\"");
|
||||
assert_inherits(a, "b");
|
||||
}
|
||||
test(testAssertInherits, "test for assert[_not]_exists and insert_inherits")
|
||||
test(testAssertInherits, "test for assert[_not]_own_property and insert_inherits")
|
||||
|
||||
test(function()
|
||||
{
|
||||
|
@ -398,7 +398,7 @@
|
|||
},
|
||||
{
|
||||
"status_string": "PASS",
|
||||
"name": "test for assert[_not]_exists and insert_inherits",
|
||||
"name": "test for assert[_not]_own_property and insert_inherits",
|
||||
"message": null,
|
||||
"properties": {}
|
||||
},
|
||||
|
|
|
@ -1262,6 +1262,13 @@ policies and contribution forms [3].
|
|||
}
|
||||
expose(assert_own_property, "assert_own_property");
|
||||
|
||||
function assert_not_own_property(object, property_name, description) {
|
||||
assert(!object.hasOwnProperty(property_name),
|
||||
"assert_not_own_property", description,
|
||||
"unexpected property ${p} is found on object", {p:property_name});
|
||||
}
|
||||
expose(assert_not_own_property, "assert_not_own_property");
|
||||
|
||||
function _assert_inherits(name) {
|
||||
return function (object, property_name, description)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче