mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +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
Notes:
sideshowbarker
2024-07-19 00:37:58 +09:00
Author: https://github.com/Lubrsi
Commit: 200c7572b7
Pull-request: https://github.com/SerenityOS/serenity/pull/4524
Reviewed-by: https://github.com/linusg ✅
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