mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-03 06:40:05 +00:00
Libraries: Move to Userland/Libraries/
This commit is contained in:
parent
dc28c07fa5
commit
13d7c09125
Notes:
sideshowbarker
2024-07-18 23:53:55 +09:00
Author: https://github.com/awesomekling
Commit: 13d7c09125
1857 changed files with 266 additions and 274 deletions
|
@ -1,41 +0,0 @@
|
|||
describe("function declarations in if statement clauses", () => {
|
||||
test("if clause", () => {
|
||||
if (true) function foo() {}
|
||||
if (false) function bar() {}
|
||||
expect(typeof globalThis.foo).toBe("function");
|
||||
expect(typeof globalThis.bar).toBe("undefined");
|
||||
});
|
||||
|
||||
test("else clause", () => {
|
||||
if (false);
|
||||
else function foo() {}
|
||||
if (true);
|
||||
else function bar() {}
|
||||
expect(typeof globalThis.foo).toBe("function");
|
||||
expect(typeof globalThis.bar).toBe("undefined");
|
||||
});
|
||||
|
||||
test("if and else clause", () => {
|
||||
if (true) function foo() {}
|
||||
else function bar() {}
|
||||
expect(typeof globalThis.foo).toBe("function");
|
||||
expect(typeof globalThis.bar).toBe("undefined");
|
||||
});
|
||||
|
||||
test("syntax error in strict mode", () => {
|
||||
expect(`
|
||||
"use strict";
|
||||
if (true) function foo() {}
|
||||
`).not.toEval();
|
||||
expect(`
|
||||
"use strict";
|
||||
if (false);
|
||||
else function foo() {}
|
||||
`).not.toEval();
|
||||
expect(`
|
||||
"use strict";
|
||||
if (false) function foo() {}
|
||||
else function bar() {}
|
||||
`).not.toEval();
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue