mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-11 17:37:33 +02:00
Add 39 test cases exercising AST dump output and scope analysis. Tests cover local/global identifier marking, eval/with poisoning, destructuring, closures, hoisting, classes, generators, and more.
31 lines
454 B
JavaScript
31 lines
454 B
JavaScript
function try_catch() {
|
|
let x = 1;
|
|
try {
|
|
let y = 2;
|
|
return x + y;
|
|
} catch (e) {
|
|
return e;
|
|
}
|
|
}
|
|
|
|
function catch_parameter() {
|
|
try {
|
|
throw 1;
|
|
} catch (err) {
|
|
let msg = err;
|
|
return msg;
|
|
}
|
|
}
|
|
|
|
function try_catch_finally() {
|
|
let result = 0;
|
|
try {
|
|
result = 1;
|
|
} catch (e) {
|
|
result = 2;
|
|
} finally {
|
|
result = result + 10;
|
|
}
|
|
return result;
|
|
}
|