mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-03 08:52:54 +00:00
LibJS: Accept symbol property in the in
operator
This is used by discord.com and allowed by the specification: https://tc39.es/ecma262/#sec-relational-operators-runtime-semantics-evaluation
This commit is contained in:
parent
7744048d0f
commit
586f10b6e1
Notes:
sideshowbarker
2024-07-18 20:09:25 +09:00
Author: https://github.com/IdanHo
Commit: 586f10b6e1
Pull-request: https://github.com/SerenityOS/serenity/pull/6387
2 changed files with 5 additions and 3 deletions
|
@ -1,10 +1,12 @@
|
|||
test("in operator with objects", () => {
|
||||
const o = { foo: "bar", bar: undefined };
|
||||
const sym = Symbol();
|
||||
const o = { foo: "bar", bar: undefined, [sym]: "qux" };
|
||||
expect("" in o).toBeFalse();
|
||||
expect("foo" in o).toBeTrue();
|
||||
expect("bar" in o).toBeTrue();
|
||||
expect("baz" in o).toBeFalse();
|
||||
expect("toString" in o).toBeTrue();
|
||||
expect(sym in o).toBeTrue();
|
||||
});
|
||||
|
||||
test("in operator with arrays", () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue