1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 04:38:11 +00:00

LibJS: Implement void operator

This commit is contained in:
Linus Groh 2020-04-15 17:55:03 +01:00 committed by Andreas Kling
parent beda751d33
commit d30db07048
4 changed files with 34 additions and 1 deletions

View file

@ -0,0 +1,20 @@
load("test-common.js");
try {
assert(void "" === undefined);
assert(void "foo" === undefined);
assert(void 1 === undefined);
assert(void 42 === undefined);
assert(void true === undefined);
assert(void false === undefined);
assert(void null === undefined);
assert(void undefined === undefined);
assert(void function () {} === undefined);
assert(void (() => {}) === undefined);
assert(void (() => "hello friends")() === undefined);
assert((() => void "hello friends")() === undefined);
console.log("PASS");
} catch (e) {
console.log("FAIL: " + e);
}