mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-26 19:28:59 +00:00
LibJS: Simplify Intl.DurationFormat.prototype.resolvedOptions
This is an editorial change in the ECMA-402 spec. See:
e3d3406
This commit is contained in:
parent
56a6daee4d
commit
2f023c2d9c
Notes:
github-actions[bot]
2025-03-04 12:37:19 +00:00
Author: https://github.com/trflynn89
Commit: 2f023c2d9c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3785
1 changed files with 7 additions and 8 deletions
|
@ -55,19 +55,18 @@ JS_DEFINE_NATIVE_FUNCTION(DurationFormatPrototype::resolved_options)
|
||||||
// b. Let v be the value of df's internal slot whose name is the Internal Slot value of the current row.
|
// b. Let v be the value of df's internal slot whose name is the Internal Slot value of the current row.
|
||||||
|
|
||||||
// c. If p is "fractionalDigits", then
|
// c. If p is "fractionalDigits", then
|
||||||
// i. If v is not undefined, set v to 𝔽(v).
|
// i. If v is not undefined, perform ! CreateDataPropertyOrThrow(options, p, 𝔽(v)).
|
||||||
|
// NOTE: This case is handled separately below.
|
||||||
|
|
||||||
// d. Else,
|
// d. Else,
|
||||||
// i. Assert: v is not undefined.
|
// i. Assert: v is not undefined.
|
||||||
|
// ii. If v is "fractional", then
|
||||||
// e. If v is "fractional", then
|
|
||||||
if (value == "fractional"sv) {
|
if (value == "fractional"sv) {
|
||||||
// i. Assert: The Internal Slot value of the current row is [[MillisecondsStyle]], [[MicrosecondsStyle]], or [[NanosecondsStyle]].
|
// 1. Assert: The Internal Slot value of the current row is [[MillisecondsStyle]], [[MicrosecondsStyle]], or [[NanosecondsStyle]] .
|
||||||
// ii. Set v to "numeric".
|
// 2. Set v to "numeric".
|
||||||
value = "numeric"sv;
|
value = "numeric"sv;
|
||||||
}
|
}
|
||||||
|
// iii. Perform ! CreateDataPropertyOrThrow(options, p, v).
|
||||||
// f. If v is not undefined, then
|
|
||||||
// i. Perform ! CreateDataPropertyOrThrow(options, p, v).
|
|
||||||
MUST(options->create_data_property_or_throw(property, PrimitiveString::create(vm, value)));
|
MUST(options->create_data_property_or_throw(property, PrimitiveString::create(vm, value)));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue