From 0c5c6a99446ad185251961d7e86e1853b5f33d7a Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Sun, 20 Jul 2025 08:10:37 -0400 Subject: [PATCH] LibJS: Use consistent wording around NewTarget in Temporal constructors This is an editorial change in the Temporal proposal. See: https://github.com/tc39/proposal-temporal/commit/e454171 --- Libraries/LibJS/Runtime/Temporal/DurationConstructor.cpp | 5 ++--- Libraries/LibJS/Runtime/Temporal/InstantConstructor.cpp | 5 ++--- .../LibJS/Runtime/Temporal/PlainDateTimeConstructor.cpp | 5 ++--- Libraries/LibJS/Runtime/Temporal/PlainTimeConstructor.cpp | 5 ++--- .../LibJS/Runtime/Temporal/PlainYearMonthConstructor.cpp | 5 ++--- .../LibJS/Runtime/Temporal/ZonedDateTimeConstructor.cpp | 5 ++--- 6 files changed, 12 insertions(+), 18 deletions(-) diff --git a/Libraries/LibJS/Runtime/Temporal/DurationConstructor.cpp b/Libraries/LibJS/Runtime/Temporal/DurationConstructor.cpp index 17b071d04ce..3118265b0ad 100644 --- a/Libraries/LibJS/Runtime/Temporal/DurationConstructor.cpp +++ b/Libraries/LibJS/Runtime/Temporal/DurationConstructor.cpp @@ -1,7 +1,7 @@ /* * Copyright (c) 2021-2023, Linus Groh * Copyright (c) 2021, Luke Wilde - * Copyright (c) 2024, Tim Flynn + * Copyright (c) 2024-2025, Tim Flynn * * SPDX-License-Identifier: BSD-2-Clause */ @@ -42,8 +42,7 @@ ThrowCompletionOr DurationConstructor::call() { auto& vm = this->vm(); - // 1. If NewTarget is undefined, then - // a. Throw a TypeError exception. + // 1. If NewTarget is undefined, throw a TypeError exception. return vm.throw_completion(ErrorType::ConstructorWithoutNew, "Temporal.Duration"); } diff --git a/Libraries/LibJS/Runtime/Temporal/InstantConstructor.cpp b/Libraries/LibJS/Runtime/Temporal/InstantConstructor.cpp index 00e64e271af..c5471454c75 100644 --- a/Libraries/LibJS/Runtime/Temporal/InstantConstructor.cpp +++ b/Libraries/LibJS/Runtime/Temporal/InstantConstructor.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2021-2023, Linus Groh - * Copyright (c) 2024, Tim Flynn + * Copyright (c) 2024-2025, Tim Flynn * * SPDX-License-Identifier: BSD-2-Clause */ @@ -44,8 +44,7 @@ ThrowCompletionOr InstantConstructor::call() { auto& vm = this->vm(); - // 1. If NewTarget is undefined, then - // a. Throw a TypeError exception. + // 1. If NewTarget is undefined, throw a TypeError exception. return vm.throw_completion(ErrorType::ConstructorWithoutNew, "Temporal.Instant"); } diff --git a/Libraries/LibJS/Runtime/Temporal/PlainDateTimeConstructor.cpp b/Libraries/LibJS/Runtime/Temporal/PlainDateTimeConstructor.cpp index 175231b884a..786db86e200 100644 --- a/Libraries/LibJS/Runtime/Temporal/PlainDateTimeConstructor.cpp +++ b/Libraries/LibJS/Runtime/Temporal/PlainDateTimeConstructor.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2021-2023, Linus Groh - * Copyright (c) 2024, Tim Flynn + * Copyright (c) 2024-2025, Tim Flynn * * SPDX-License-Identifier: BSD-2-Clause */ @@ -46,8 +46,7 @@ ThrowCompletionOr PlainDateTimeConstructor::call() { auto& vm = this->vm(); - // 1. If NewTarget is undefined, then - // a. Throw a TypeError exception. + // 1. If NewTarget is undefined, throw a TypeError exception. return vm.throw_completion(ErrorType::ConstructorWithoutNew, "Temporal.PlainDateTime"); } diff --git a/Libraries/LibJS/Runtime/Temporal/PlainTimeConstructor.cpp b/Libraries/LibJS/Runtime/Temporal/PlainTimeConstructor.cpp index 64f2b26845f..0bbecf35031 100644 --- a/Libraries/LibJS/Runtime/Temporal/PlainTimeConstructor.cpp +++ b/Libraries/LibJS/Runtime/Temporal/PlainTimeConstructor.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2021-2023, Linus Groh - * Copyright (c) 2024, Tim Flynn + * Copyright (c) 2024-2025, Tim Flynn * * SPDX-License-Identifier: BSD-2-Clause */ @@ -40,8 +40,7 @@ ThrowCompletionOr PlainTimeConstructor::call() { auto& vm = this->vm(); - // 1. If NewTarget is undefined, then - // a. Throw a TypeError exception. + // 1. If NewTarget is undefined, throw a TypeError exception. return vm.throw_completion(ErrorType::ConstructorWithoutNew, "Temporal.PlainTime"); } diff --git a/Libraries/LibJS/Runtime/Temporal/PlainYearMonthConstructor.cpp b/Libraries/LibJS/Runtime/Temporal/PlainYearMonthConstructor.cpp index 11f76dc42e6..3e5031c4a8f 100644 --- a/Libraries/LibJS/Runtime/Temporal/PlainYearMonthConstructor.cpp +++ b/Libraries/LibJS/Runtime/Temporal/PlainYearMonthConstructor.cpp @@ -1,7 +1,7 @@ /* * Copyright (c) 2021-2023, Linus Groh * Copyright (c) 2021, Luke Wilde - * Copyright (c) 2024, Tim Flynn + * Copyright (c) 2024-2025, Tim Flynn * * SPDX-License-Identifier: BSD-2-Clause */ @@ -41,8 +41,7 @@ ThrowCompletionOr PlainYearMonthConstructor::call() { auto& vm = this->vm(); - // 1. If NewTarget is undefined, then - // a. Throw a TypeError exception. + // 1. If NewTarget is undefined, throw a TypeError exception. return vm.throw_completion(ErrorType::ConstructorWithoutNew, "Temporal.PlainYearMonth"); } diff --git a/Libraries/LibJS/Runtime/Temporal/ZonedDateTimeConstructor.cpp b/Libraries/LibJS/Runtime/Temporal/ZonedDateTimeConstructor.cpp index 86ce133c640..f6d0f738065 100644 --- a/Libraries/LibJS/Runtime/Temporal/ZonedDateTimeConstructor.cpp +++ b/Libraries/LibJS/Runtime/Temporal/ZonedDateTimeConstructor.cpp @@ -1,7 +1,7 @@ /* * Copyright (c) 2021-2023, Linus Groh * Copyright (c) 2021, Luke Wilde - * Copyright (c) 2024, Tim Flynn + * Copyright (c) 2024-2025, Tim Flynn * * SPDX-License-Identifier: BSD-2-Clause */ @@ -44,8 +44,7 @@ ThrowCompletionOr ZonedDateTimeConstructor::call() { auto& vm = this->vm(); - // 1. If NewTarget is undefined, then - // a. Throw a TypeError exception. + // 1. If NewTarget is undefined, throw a TypeError exception. return vm.throw_completion(ErrorType::ConstructorWithoutNew, "Temporal.ZonedDateTime"); }