mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:57:44 +00:00
LibJS: Handle Object.prototype.hasOwnProperty() with no arg correctly
I.e. the same as hasOwnProperty(undefined) or hasOwnProperty("undefined") :^)
This commit is contained in:
parent
4419685b7e
commit
0a0ba64383
2 changed files with 6 additions and 2 deletions
|
@ -5,6 +5,12 @@ try {
|
|||
o.foo = 1;
|
||||
assert(o.hasOwnProperty("foo") === true);
|
||||
assert(o.hasOwnProperty("bar") === false);
|
||||
assert(o.hasOwnProperty() === false);
|
||||
assert(o.hasOwnProperty(undefined) === false);
|
||||
o.undefined = 2;
|
||||
assert(o.hasOwnProperty() === true);
|
||||
assert(o.hasOwnProperty(undefined) === true);
|
||||
|
||||
console.log("PASS");
|
||||
} catch (e) {
|
||||
console.log("FAIL: " + e);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue