mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibJS: Update spec comments in GetOption and DefaultNumberOption AOs
This is an editorial change in the Intl spec.
See: 913ca6d
This commit is contained in:
parent
dbab20782e
commit
a2f629f38a
Notes:
sideshowbarker
2024-07-18 00:44:16 +09:00
Author: https://github.com/trflynn89
Commit: a2f629f38a
Pull-request: https://github.com/SerenityOS/serenity/pull/11059
Reviewed-by: https://github.com/linusg ✅
1 changed files with 3 additions and 3 deletions
|
@ -619,12 +619,12 @@ ThrowCompletionOr<Value> get_option(GlobalObject& global_object, Object const& o
|
||||||
|
|
||||||
// 5. If type is "boolean", then
|
// 5. If type is "boolean", then
|
||||||
if (type == Value::Type::Boolean) {
|
if (type == Value::Type::Boolean) {
|
||||||
// a. Let value be ! ToBoolean(value).
|
// a. Set value to ! ToBoolean(value).
|
||||||
value = Value(value.to_boolean());
|
value = Value(value.to_boolean());
|
||||||
}
|
}
|
||||||
// 6. If type is "string", then
|
// 6. If type is "string", then
|
||||||
else {
|
else {
|
||||||
// a. Let value be ? ToString(value).
|
// a. Set value to ? ToString(value).
|
||||||
value = TRY(value.to_primitive_string(global_object));
|
value = TRY(value.to_primitive_string(global_object));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -649,7 +649,7 @@ ThrowCompletionOr<Optional<int>> default_number_option(GlobalObject& global_obje
|
||||||
if (value.is_undefined())
|
if (value.is_undefined())
|
||||||
return fallback;
|
return fallback;
|
||||||
|
|
||||||
// 2. Let value be ? ToNumber(value).
|
// 2. Set value to ? ToNumber(value).
|
||||||
value = TRY(value.to_number(global_object));
|
value = TRY(value.to_number(global_object));
|
||||||
|
|
||||||
// 3. If value is NaN or less than minimum or greater than maximum, throw a RangeError exception.
|
// 3. If value is NaN or less than minimum or greater than maximum, throw a RangeError exception.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue