mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:48:12 +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
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