1
Fork 0
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:
Ali Mohammad Pur 2021-07-11 15:34:55 +04:30 committed by Linus Groh
parent 77a5144264
commit 049e210cfa
3 changed files with 142 additions and 31 deletions

View file

@ -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());
}
}
}