mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:17:35 +00:00
LibJS+Everywhere: Return strings by value from PrimitiveString
It turns out return a ThrowCompletionOr<T const&> is flawed, as the GCC expansion trick used with TRY will always make a copy. PrimitiveString is luckily the only such use case.
This commit is contained in:
parent
9a120d7243
commit
a59ebdac2d
10 changed files with 22 additions and 21 deletions
|
@ -1604,7 +1604,7 @@ ThrowCompletionOr<MathematicalValue> to_intl_mathematical_value(VM& vm, Value va
|
|||
|
||||
// 3. If Type(primValue) is String,
|
||||
// a. Let str be primValue.
|
||||
auto const& string = TRY(primitive_value.as_string().deprecated_string());
|
||||
auto string = TRY(primitive_value.as_string().deprecated_string());
|
||||
|
||||
// Step 4 handled separately by the FIXME above.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue