1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:38:11 +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:
Luke 2020-12-24 17:51:28 +00:00 committed by Andreas Kling
parent d46de3aeb4
commit 200c7572b7
4 changed files with 32 additions and 0 deletions

View file

@ -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();
});