1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:48:12 +00:00

LibJS: Convert to_number() to ThrowCompletionOr

This commit is contained in:
Idan Horowitz 2021-10-17 23:20:05 +03:00
parent a36ee213b9
commit 20d990563c
22 changed files with 149 additions and 343 deletions

View file

@ -870,7 +870,7 @@ Value canonical_numeric_index_string(GlobalObject& global_object, PropertyName c
return Value(-0.0);
// 3. Let n be ! ToNumber(argument).
auto n = argument.to_number(global_object);
auto n = MUST(argument.to_number(global_object));
// 4. If SameValue(! ToString(n), argument) is false, return undefined.
if (!same_value(MUST(n.to_primitive_string(global_object)), argument))