1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:17:44 +00:00

LibJS: Use Identifier to represent FunctionParameter name

Using identifier instead of string allows to store supplemental
information about whether it can be represented as local variable.
This commit is contained in:
Aliaksandr Kalenik 2023-07-06 17:49:38 +02:00 committed by Andreas Kling
parent 2f1d6c0b9a
commit 2e81cc4cf7
5 changed files with 50 additions and 31 deletions

View file

@ -1128,7 +1128,7 @@ Object* create_mapped_arguments_object(VM& vm, FunctionObject& function, Vector<
VERIFY(formals.size() <= NumericLimits<i32>::max());
for (i32 index = static_cast<i32>(formals.size()) - 1; index >= 0; --index) {
// a. Let name be parameterNames[index].
auto const& name = formals[index].binding.get<DeprecatedFlyString>();
auto const& name = formals[index].binding.get<NonnullRefPtr<Identifier const>>()->string();
// b. If name is not an element of mappedNames, then
if (mapped_names.contains(name))