mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibJS: Implement rest parameters
This commit is contained in:
parent
9df71afdb3
commit
454c1e6bbe
Notes:
sideshowbarker
2024-07-19 06:59:12 +09:00
Author: https://github.com/linusg
Commit: 454c1e6bbe
Pull-request: https://github.com/SerenityOS/serenity/pull/2099
Reviewed-by: https://github.com/awesomekling
5 changed files with 98 additions and 10 deletions
|
@ -695,10 +695,11 @@ void FunctionNode::dump(int indent, const char* class_name) const
|
|||
|
||||
for (auto& parameter : m_parameters) {
|
||||
print_indent(indent + 2);
|
||||
if (parameter.is_rest)
|
||||
printf("...");
|
||||
printf("%s\n", parameter.name.characters());
|
||||
if (parameter.default_value) {
|
||||
if (parameter.default_value)
|
||||
parameter.default_value->dump(indent + 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!m_variables.is_empty()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue