diff options
author | Linus Groh <mail@linusgroh.de> | 2022-06-27 23:29:11 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-06-29 07:35:42 +0100 |
commit | ca85e157e8158f953f1b9fef4d22dd00e9f7a1cc (patch) | |
tree | d4c2a3a91c99402880a7ffb03b393c1d5ce9836e /Userland | |
parent | 3720f4bd8fea7ff92c1e721a89b3682ca79eb07c (diff) | |
download | serenity-ca85e157e8158f953f1b9fef4d22dd00e9f7a1cc.zip |
LibJS: Use null-prototype objects in a few more places in Temporal
This is a normative change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/334479f
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp | 8 | ||||
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.cpp | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp index 2b72ac541a..9e71aeba76 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp @@ -742,8 +742,8 @@ ThrowCompletionOr<Object*> merge_largest_unit_option(GlobalObject& global_object { auto& vm = global_object.vm(); - // 1. Let merged be OrdinaryObjectCreate(%Object.prototype%). - auto* merged = Object::create(global_object, global_object.object_prototype()); + // 1. Let merged be OrdinaryObjectCreate(null). + auto* merged = Object::create(global_object, nullptr); // 2. Let keys be ? EnumerableOwnPropertyNames(options, key). auto keys = TRY(options.enumerable_own_property_names(Object::PropertyKind::Key)); @@ -1768,8 +1768,8 @@ ThrowCompletionOr<Object*> prepare_temporal_fields(GlobalObject& global_object, { auto& vm = global_object.vm(); - // 1. Let result be OrdinaryObjectCreate(%Object.prototype%). - auto* result = Object::create(global_object, global_object.object_prototype()); + // 1. Let result be OrdinaryObjectCreate(null). + auto* result = Object::create(global_object, nullptr); VERIFY(result); // 2. Let any be false. diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.cpp index af182edf29..ceb1276a15 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.cpp @@ -363,8 +363,8 @@ ThrowCompletionOr<PlainYearMonth*> add_duration_to_or_subtract_duration_from_pla // 13. Let durationToAdd be ! CreateTemporalDuration(duration.[[Years]], duration.[[Months]], duration.[[Weeks]], balanceResult.[[Days]], 0, 0, 0, 0, 0, 0). auto* duration_to_add = MUST(create_temporal_duration(global_object, duration->years(), duration->months(), duration->weeks(), balance_result.days, 0, 0, 0, 0, 0, 0)); - // 14. Let optionsCopy be OrdinaryObjectCreate(%Object.prototype%). - auto* options_copy = Object::create(global_object, global_object.object_prototype()); + // 14. Let optionsCopy be OrdinaryObjectCreate(null). + auto* options_copy = Object::create(global_object, nullptr); // 15. Let entries be ? EnumerableOwnPropertyNames(options, key+value). auto entries = TRY(options->enumerable_own_property_names(Object::PropertyKind::KeyAndValue)); |