From 69b8079b11bc83ecef5216bac61a71c3eae8bcd6 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Sat, 18 Dec 2021 17:15:43 +0000 Subject: [PATCH] LibJS: Fix "smallestUnit" property name typo in a couple of places This is a normative change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/900e4bc --- .../Libraries/LibJS/Runtime/Temporal/DurationPrototype.cpp | 3 +-- Userland/Libraries/LibJS/Runtime/Temporal/InstantPrototype.cpp | 3 +-- .../LibJS/Runtime/Temporal/PlainDateTimePrototype.cpp | 3 +-- .../Libraries/LibJS/Runtime/Temporal/PlainTimePrototype.cpp | 3 +-- .../LibJS/Runtime/Temporal/ZonedDateTimePrototype.cpp | 3 +-- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/DurationPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/DurationPrototype.cpp index d163fecb52..3629277041 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/DurationPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/DurationPrototype.cpp @@ -359,8 +359,7 @@ JS_DEFINE_NATIVE_FUNCTION(DurationPrototype::round) // b. Set roundTo to ! OrdinaryObjectCreate(null). round_to = Object::create(global_object, nullptr); - // FIXME: "_smallestUnit_" is a spec bug, see https://github.com/tc39/proposal-temporal/pull/1931 - // c. Perform ! CreateDataPropertyOrThrow(roundTo, "_smallestUnit_", paramString). + // c. Perform ! CreateDataPropertyOrThrow(roundTo, "smallestUnit", paramString). MUST(round_to->create_data_property_or_throw(vm.names.smallestUnit, vm.argument(0))); } // 5. Else, diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/InstantPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/InstantPrototype.cpp index 3b4a099737..5c2462f81f 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/InstantPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/InstantPrototype.cpp @@ -265,8 +265,7 @@ JS_DEFINE_NATIVE_FUNCTION(InstantPrototype::round) // b. Set roundTo to ! OrdinaryObjectCreate(null). round_to = Object::create(global_object, nullptr); - // FIXME: "_smallestUnit_" is a spec bug, see https://github.com/tc39/proposal-temporal/pull/1931 - // c. Perform ! CreateDataPropertyOrThrow(roundTo, "_smallestUnit_", paramString). + // c. Perform ! CreateDataPropertyOrThrow(roundTo, "smallestUnit", paramString). MUST(round_to->create_data_property_or_throw(vm.names.smallestUnit, vm.argument(0))); } // 5. Else, diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimePrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimePrototype.cpp index ea0e9b744e..248c571833 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimePrototype.cpp @@ -641,8 +641,7 @@ JS_DEFINE_NATIVE_FUNCTION(PlainDateTimePrototype::round) // b. Set roundTo to ! OrdinaryObjectCreate(null). round_to = Object::create(global_object, nullptr); - // FIXME: "_smallestUnit_" is a spec bug, see https://github.com/tc39/proposal-temporal/pull/1931 - // c. Perform ! CreateDataPropertyOrThrow(roundTo, "_smallestUnit_", paramString). + // c. Perform ! CreateDataPropertyOrThrow(roundTo, "smallestUnit", paramString). MUST(round_to->create_data_property_or_throw(vm.names.smallestUnit, vm.argument(0))); } // 5. Else, diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimePrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimePrototype.cpp index b8885c6937..311fc34fcc 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimePrototype.cpp @@ -365,8 +365,7 @@ JS_DEFINE_NATIVE_FUNCTION(PlainTimePrototype::round) // b. Set roundTo to ! OrdinaryObjectCreate(null). round_to = Object::create(global_object, nullptr); - // FIXME: "_smallestUnit_" is a spec bug, see https://github.com/tc39/proposal-temporal/pull/1931 - // c. Perform ! CreateDataPropertyOrThrow(roundTo, "_smallestUnit_", paramString). + // c. Perform ! CreateDataPropertyOrThrow(roundTo, "smallestUnit", paramString). MUST(round_to->create_data_property_or_throw(vm.names.smallestUnit, vm.argument(0))); } // 5. Else, diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.cpp index 08d60aad31..3b2ac14201 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.cpp @@ -1117,8 +1117,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::round) // b. Set roundTo to ! OrdinaryObjectCreate(null). round_to = Object::create(global_object, nullptr); - // FIXME: "_smallestUnit_" is a spec bug, see https://github.com/tc39/proposal-temporal/pull/1931 - // c. Perform ! CreateDataPropertyOrThrow(roundTo, "_smallestUnit_", paramString). + // c. Perform ! CreateDataPropertyOrThrow(roundTo, "smallestUnit", paramString). MUST(round_to->create_data_property_or_throw(vm.names.smallestUnit, vm.argument(0))); } // 5. Else,