summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Tests
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2021-04-17 01:46:48 +0300
committerLinus Groh <mail@linusgroh.de>2021-04-17 00:59:36 +0200
commit586f10b6e17a36b045377988205230b29892be0f (patch)
tree56c8c87acc7be8da2cb3ee7ebcf0c68244286dab /Userland/Libraries/LibJS/Tests
parent7744048d0fde1602b8bb68b98d821358ca32c480 (diff)
downloadserenity-586f10b6e17a36b045377988205230b29892be0f.zip
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
Diffstat (limited to 'Userland/Libraries/LibJS/Tests')
-rw-r--r--Userland/Libraries/LibJS/Tests/operators/in-operator-basic.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Tests/operators/in-operator-basic.js b/Userland/Libraries/LibJS/Tests/operators/in-operator-basic.js
index 1deec41f76..a036171c27 100644
--- a/Userland/Libraries/LibJS/Tests/operators/in-operator-basic.js
+++ b/Userland/Libraries/LibJS/Tests/operators/in-operator-basic.js
@@ -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", () => {