mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 17:47:44 +00:00
LibJS: Rework Identifier parsing to match the spec more closely
This commit is contained in:
parent
77a5144264
commit
049e210cfa
3 changed files with 142 additions and 31 deletions
|
@ -1455,6 +1455,10 @@ void BindingPattern::for_each_bound_name(C&& callback) const
|
|||
callback(alias.get<NonnullRefPtr<Identifier>>()->string());
|
||||
} else if (alias.has<NonnullRefPtr<BindingPattern>>()) {
|
||||
alias.get<NonnullRefPtr<BindingPattern>>()->for_each_bound_name(forward<C>(callback));
|
||||
} else {
|
||||
auto& name = entry.name;
|
||||
if (name.has<NonnullRefPtr<Identifier>>())
|
||||
callback(name.get<NonnullRefPtr<Identifier>>()->string());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue