mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibJS: Avoid RequireObjectCoercible when creating super references
This is part of an old normative change that happened soon after
Andreas made `super` closer to spec in 1270df2
.
See https://github.com/tc39/ecma262/pull/2267/
This was introduced into bytecode by virtue of copy and paste :^)
Bytecode results:
Summary:
Diff Tests:
+2 ✅ -2 ❌
This commit is contained in:
parent
b271d9a6bf
commit
442ca4f9b4
Notes:
sideshowbarker
2024-07-18 02:47:59 +09:00
Author: https://github.com/Lubrsi Commit: https://github.com/SerenityOS/serenity/commit/442ca4f9b4 Pull-request: https://github.com/SerenityOS/serenity/pull/19820 Reviewed-by: https://github.com/Hendiadyoin1
2 changed files with 3 additions and 9 deletions
|
@ -660,10 +660,7 @@ ThrowCompletionOr<void> ResolveSuperBase::execute_impl(Bytecode::Interpreter& in
|
|||
VERIFY(env.has_super_binding());
|
||||
|
||||
// 3. Let baseValue be ? env.GetSuperBase().
|
||||
auto base_value = TRY(env.get_super_base());
|
||||
|
||||
// 4. Let bv be ? RequireObjectCoercible(baseValue).
|
||||
interpreter.accumulator() = TRY(require_object_coercible(vm, base_value));
|
||||
interpreter.accumulator() = TRY(env.get_super_base());
|
||||
|
||||
return {};
|
||||
}
|
||||
|
|
|
@ -513,11 +513,8 @@ ThrowCompletionOr<Reference> make_super_property_reference(VM& vm, Value actual_
|
|||
// 3. Let baseValue be ? env.GetSuperBase().
|
||||
auto base_value = TRY(env.get_super_base());
|
||||
|
||||
// 4. Let bv be ? RequireObjectCoercible(baseValue).
|
||||
auto bv = TRY(require_object_coercible(vm, base_value));
|
||||
|
||||
// 5. Return the Reference Record { [[Base]]: bv, [[ReferencedName]]: propertyKey, [[Strict]]: strict, [[ThisValue]]: actualThis }.
|
||||
return Reference { bv, property_key, actual_this, strict };
|
||||
// 4. Return the Reference Record { [[Base]]: baseValue, [[ReferencedName]]: propertyKey, [[Strict]]: strict, [[ThisValue]]: actualThis }.
|
||||
return Reference { base_value, property_key, actual_this, strict };
|
||||
}
|
||||
|
||||
// 19.2.1.1 PerformEval ( x, strictCaller, direct ), https://tc39.es/ecma262/#sec-performeval
|
||||
|
|
Loading…
Reference in a new issue