mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-11 09:27:00 +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.
20 lines
323 B
JavaScript
20 lines
323 B
JavaScript
function rest_params(a, ...rest) {
|
|
return a + rest.length;
|
|
}
|
|
|
|
function default_params(a, b = 10) {
|
|
return a + b;
|
|
}
|
|
|
|
function destructured_array([x, y]) {
|
|
return x + y;
|
|
}
|
|
|
|
function destructured_object({ a, b }) {
|
|
return a + b;
|
|
}
|
|
|
|
function mixed(first, { x }, ...rest) {
|
|
return first + x + rest.length;
|
|
}
|