mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 19:38:12 +00:00
LibJS: Implement Object.prototype.propertyIsEnumerable
Spec: https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable This is used by core-js, which is used by frameworks such as Vue.
This commit is contained in:
parent
d46de3aeb4
commit
200c7572b7
4 changed files with 32 additions and 0 deletions
|
@ -0,0 +1,15 @@
|
|||
test("basic functionality", () => {
|
||||
var o = {};
|
||||
|
||||
o.foo = 1;
|
||||
expect(o.propertyIsEnumerable("foo")).toBeTrue();
|
||||
expect(o.propertyIsEnumerable("bar")).toBeFalse();
|
||||
expect(o.propertyIsEnumerable()).toBeFalse();
|
||||
expect(o.propertyIsEnumerable(undefined)).toBeFalse();
|
||||
|
||||
o.undefined = 2;
|
||||
expect(o.propertyIsEnumerable()).toBeTrue();
|
||||
expect(o.propertyIsEnumerable(undefined)).toBeTrue();
|
||||
|
||||
expect(globalThis.propertyIsEnumerable("globalThis")).toBeFalse();
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue