1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 17:47:36 +00:00

LibJS: Accept symbol property in ObjectPrototype::hasOwnProperty

This is used by discord.com and allowed by the specification
(https://tc39.es/ecma262/#sec-topropertykey)
This commit is contained in:
Idan Horowitz 2021-04-16 01:33:12 +03:00 committed by Linus Groh
parent 2381b19719
commit fff7aceb9d
2 changed files with 7 additions and 2 deletions

View file

@ -10,4 +10,9 @@ test("basic functionality", () => {
o.undefined = 2;
expect(o.hasOwnProperty()).toBeTrue();
expect(o.hasOwnProperty(undefined)).toBeTrue();
var testSymbol = Symbol("real");
o[testSymbol] = 3;
expect(o.hasOwnProperty(testSymbol)).toBeTrue();
expect(o.hasOwnProperty(Symbol("fake"))).toBeFalse();
});