mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-28 21:26:22 +00:00
Everywhere: Hoist the Libraries folder to the top-level
This commit is contained in:
parent
950e819ee7
commit
93712b24bf
Notes:
github-actions[bot]
2024-11-10 11:51:52 +00:00
Author: https://github.com/trflynn89
Commit: 93712b24bf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2256
Reviewed-by: https://github.com/sideshowbarker
4547 changed files with 104 additions and 113 deletions
65
Libraries/LibJS/Tests/automatic-semicolon-insertion.js
Normal file
65
Libraries/LibJS/Tests/automatic-semicolon-insertion.js
Normal file
|
@ -0,0 +1,65 @@
|
|||
test("Issue #1829, if-else without braces or semicolons", () => {
|
||||
const source = `if (1)
|
||||
foo;
|
||||
else
|
||||
bar;
|
||||
|
||||
if (1)
|
||||
foo
|
||||
else
|
||||
bar
|
||||
|
||||
if (1)
|
||||
foo
|
||||
else
|
||||
bar;`;
|
||||
|
||||
expect(source).toEval();
|
||||
});
|
||||
|
||||
test("break/continue, variable declaration, do-while, and return asi", () => {
|
||||
const source = `function foo() {
|
||||
label:
|
||||
for (var i = 0; i < 4; i++) {
|
||||
break // semicolon inserted here
|
||||
continue // semicolon inserted here
|
||||
|
||||
break label // semicolon inserted here
|
||||
continue label // semicolon inserted here
|
||||
}
|
||||
|
||||
var j // semicolon inserted here
|
||||
|
||||
do {
|
||||
} while (1 === 2) // semicolon inserted here
|
||||
|
||||
return // semicolon inserted here
|
||||
1;
|
||||
var curly/* semicolon inserted here */}
|
||||
|
||||
foo();`;
|
||||
|
||||
expect(source).toEvalTo(undefined);
|
||||
});
|
||||
|
||||
test("more break and continue asi", () => {
|
||||
const source = `let counter = 0;
|
||||
let outer;
|
||||
|
||||
outer:
|
||||
for (let i = 0; i < 5; ++i) {
|
||||
for (let j = 0; j < 5; ++j) {
|
||||
continue // semicolon inserted here
|
||||
outer // semicolon inserted here
|
||||
}
|
||||
counter++;
|
||||
}
|
||||
|
||||
counter;`;
|
||||
|
||||
expect(source).toEvalTo(5);
|
||||
});
|
||||
|
||||
test("eof with no semicolon", () => {
|
||||
expect("var eof").toEval();
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue