mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 01:00:05 +00:00
LibJS/Bytecode: Use ToString instead of generic add() in ConcatString
This avoids invoking valueOf() on the values, which is observable. 48 new passes on test262. :^)
This commit is contained in:
parent
99cc33bce9
commit
8873bf5016
Notes:
sideshowbarker
2024-07-17 02:38:39 +09:00
Author: https://github.com/awesomekling
Commit: 8873bf5016
Pull-request: https://github.com/SerenityOS/serenity/pull/19624
1 changed files with 2 additions and 1 deletions
|
@ -380,7 +380,8 @@ ThrowCompletionOr<void> CopyObjectExcludingProperties::execute_impl(Bytecode::In
|
|||
ThrowCompletionOr<void> ConcatString::execute_impl(Bytecode::Interpreter& interpreter) const
|
||||
{
|
||||
auto& vm = interpreter.vm();
|
||||
interpreter.reg(m_lhs) = TRY(add(vm, interpreter.reg(m_lhs), interpreter.accumulator()));
|
||||
auto string = TRY(interpreter.accumulator().to_primitive_string(vm));
|
||||
interpreter.reg(m_lhs) = PrimitiveString::create(vm, interpreter.reg(m_lhs).as_string(), string);
|
||||
return {};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue