mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 04:52:06 +02:00
LibJS: Remove implicit wrapping/unwrapping of completion records
This is an editorial change in the ECMA-262 spec, with similar changes in some proposals. See: - https://github.com/tc39/ecma262/commit/7575f74 - https://github.com/tc39/proposal-array-grouping/commit/df899eb - https://github.com/tc39/proposal-shadowrealm/commit/9eb5a12 - https://github.com/tc39/proposal-shadowrealm/commit/c81f527
This commit is contained in:
Notes:
sideshowbarker
2024-07-17 11:22:30 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/9f3f3b0864 Pull-request: https://github.com/SerenityOS/serenity/pull/13887 Reviewed-by: https://github.com/IdanHo ✅
@@ -72,7 +72,7 @@ ThrowCompletionOr<Object*> to_date_time_options(GlobalObject& global_object, Val
|
||||
if (!options_value.is_undefined())
|
||||
options = TRY(options_value.to_object(global_object));
|
||||
|
||||
// 2. Let options be ! OrdinaryObjectCreate(options).
|
||||
// 2. Let options be OrdinaryObjectCreate(options).
|
||||
options = Object::create(global_object, options);
|
||||
|
||||
// 3. Let needDefaults be true.
|
||||
@@ -524,7 +524,7 @@ ThrowCompletionOr<Vector<PatternPartition>> format_date_time_pattern(GlobalObjec
|
||||
return static_cast<NumberFormat*>(number_format);
|
||||
};
|
||||
|
||||
// 4. Let nfOptions be ! OrdinaryObjectCreate(null).
|
||||
// 4. Let nfOptions be OrdinaryObjectCreate(null).
|
||||
auto* number_format_options = Object::create(global_object, nullptr);
|
||||
|
||||
// 5. Perform ! CreateDataPropertyOrThrow(nfOptions, "useGrouping", false).
|
||||
@@ -533,7 +533,7 @@ ThrowCompletionOr<Vector<PatternPartition>> format_date_time_pattern(GlobalObjec
|
||||
// 6. Let nf be ? Construct(%NumberFormat%, « locale, nfOptions »).
|
||||
auto* number_format = TRY(construct_number_format(number_format_options));
|
||||
|
||||
// 7. Let nf2Options be ! OrdinaryObjectCreate(null).
|
||||
// 7. Let nf2Options be OrdinaryObjectCreate(null).
|
||||
auto* number_format_options2 = Object::create(global_object, nullptr);
|
||||
|
||||
// 8. Perform ! CreateDataPropertyOrThrow(nf2Options, "minimumIntegerDigits", 2).
|
||||
@@ -553,7 +553,7 @@ ThrowCompletionOr<Vector<PatternPartition>> format_date_time_pattern(GlobalObjec
|
||||
if (date_time_format.has_fractional_second_digits()) {
|
||||
fractional_second_digits = date_time_format.fractional_second_digits();
|
||||
|
||||
// a. Let nf3Options be ! OrdinaryObjectCreate(null).
|
||||
// a. Let nf3Options be OrdinaryObjectCreate(null).
|
||||
auto* number_format_options3 = Object::create(global_object, nullptr);
|
||||
|
||||
// b. Perform ! CreateDataPropertyOrThrow(nf3Options, "minimumIntegerDigits", fractionalSecondDigits).
|
||||
@@ -835,7 +835,7 @@ ThrowCompletionOr<Array*> format_date_time_to_parts(GlobalObject& global_object,
|
||||
|
||||
// 4. For each Record { [[Type]], [[Value]] } part in parts, do
|
||||
for (auto& part : parts) {
|
||||
// a. Let O be ! OrdinaryObjectCreate(%Object.prototype%).
|
||||
// a. Let O be OrdinaryObjectCreate(%Object.prototype%).
|
||||
auto* object = Object::create(global_object, global_object.object_prototype());
|
||||
|
||||
// b. Perform ! CreateDataPropertyOrThrow(O, "type", part.[[Type]]).
|
||||
@@ -1155,7 +1155,7 @@ ThrowCompletionOr<Array*> format_date_time_range_to_parts(GlobalObject& global_o
|
||||
|
||||
// 4. For each Record { [[Type]], [[Value]], [[Source]] } part in parts, do
|
||||
for (auto& part : parts) {
|
||||
// a. Let O be ! OrdinaryObjectCreate(%ObjectPrototype%).
|
||||
// a. Let O be OrdinaryObjectCreate(%ObjectPrototype%).
|
||||
auto* object = Object::create(global_object, global_object.object_prototype());
|
||||
|
||||
// b. Perform ! CreateDataPropertyOrThrow(O, "type", part.[[Type]]).
|
||||
|
||||
Reference in New Issue
Block a user