mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 07:36:50 +00:00
Everywhere: Hoist the Libraries folder to the top-level
This commit is contained in:
committed by
Andreas Kling
parent
950e819ee7
commit
93712b24bf
26
Libraries/LibJS/Tests/operators/void-basic.js
Normal file
26
Libraries/LibJS/Tests/operators/void-basic.js
Normal file
@@ -0,0 +1,26 @@
|
||||
test("basic functionality", () => {
|
||||
expect(void "").toBeUndefined();
|
||||
expect(void "foo").toBeUndefined();
|
||||
expect(void 1).toBeUndefined();
|
||||
expect(void 42).toBeUndefined();
|
||||
expect(void true).toBeUndefined();
|
||||
expect(void false).toBeUndefined();
|
||||
expect(void null).toBeUndefined();
|
||||
expect(void undefined).toBeUndefined();
|
||||
expect(void function () {}).toBeUndefined();
|
||||
expect(void (() => {})).toBeUndefined();
|
||||
expect(void (() => "hello friends")()).toBeUndefined();
|
||||
expect((() => void "hello friends")()).toBeUndefined();
|
||||
});
|
||||
|
||||
describe("errors", () => {
|
||||
test("treats yield in generator as non variable", () => {
|
||||
expect("function f() { void yield; }").toEval();
|
||||
expect("async function f() { void yield; }").toEval();
|
||||
expect("function *f() { void yield; }").not.toEval();
|
||||
expect("async function *f() { void yield; }").not.toEval();
|
||||
|
||||
expect("class C { *f() { void yield; } }").not.toEval();
|
||||
expect("var obj = { async function *f() { void yield; } }").not.toEval();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user