LibJS: Remove redundant const_cast

The accessed field is mutable, so there's no need for this const_cast.
This commit is contained in:
Ali Mohammad Pur 2021-10-07 20:12:32 +03:30 committed by Andreas Kling
commit 6ab6321c2f
Notes: sideshowbarker 2024-07-18 02:55:52 +09:00

View file

@ -1017,7 +1017,7 @@ Reference Identifier::to_reference(Interpreter& interpreter, GlobalObject&) cons
}
auto reference = interpreter.vm().resolve_binding(string());
if (reference.environment_coordinate().has_value())
const_cast<Identifier&>(*this).m_cached_environment_coordinate = reference.environment_coordinate();
m_cached_environment_coordinate = reference.environment_coordinate();
return reference;
}