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

LibJS: Make assertion in BindThisValue mirror the spec exactly :^)

This commit is contained in:
Andreas Kling 2021-06-25 19:36:37 +02:00
parent 8cfb4c82f0
commit 06787410ad

View file

@ -70,7 +70,7 @@ Value FunctionEnvironmentRecord::get_this_binding(GlobalObject& global_object) c
// 9.1.1.3.1 BindThisValue ( V ), https://tc39.es/ecma262/#sec-bindthisvalue
Value FunctionEnvironmentRecord::bind_this_value(GlobalObject& global_object, Value this_value)
{
VERIFY(has_this_binding());
VERIFY(this_binding_status() != ThisBindingStatus::Lexical);
if (this_binding_status() == ThisBindingStatus::Initialized) {
vm().throw_exception<ReferenceError>(global_object, ErrorType::ThisIsAlreadyInitialized);
return {};