diff --git a/JSTests/stress/temporal-plaindatetime.js b/JSTests/stress/temporal-plaindatetime.js index 6391a13f7ddc5..39fff8c2ccb21 100644 --- a/JSTests/stress/temporal-plaindatetime.js +++ b/JSTests/stress/temporal-plaindatetime.js @@ -279,10 +279,6 @@ shouldBe(pdt.with({ second: 15 }).toString(), '0001-02-03T04:05:15.007008009'); shouldBe(pdt.with({ day: 30 }).toString(), '0001-02-28T04:05:06.007008009'); shouldThrow(() => { pdt.with({ day: 30 }, { overflow: 'reject' }); }, RangeError); -shouldBe(Temporal.PlainDateTime.prototype.withPlainDate.length, 1); -shouldThrow(() => { pdt.withPlainDate(); }, TypeError); -shouldBe(pdt.withPlainDate({ year: 2000, month: 10, day: 30 }).toString(), '2000-10-30T04:05:06.007008009'); - shouldBe(Temporal.PlainDateTime.prototype.withPlainTime.length, 0); shouldBe(pdt.withPlainTime().toString(), '0001-02-03T00:00:00'); shouldBe(pdt.withPlainTime({ hour: 1, minute: 2, second: 3 }).toString(), '0001-02-03T01:02:03'); diff --git a/JSTests/stress/temporal-plaintime.js b/JSTests/stress/temporal-plaintime.js index 71a571178e36c..63daf442d50e0 100644 --- a/JSTests/stress/temporal-plaintime.js +++ b/JSTests/stress/temporal-plaintime.js @@ -145,9 +145,6 @@ shouldBe(String(Temporal.PlainTime.from('2007-01-09 03:24:30[u-ca=japanese]')), let dateTime = Temporal.PlainDateTime.from('1995-12-07T03:24:30+01:00[Europe/Brussels]') shouldBe(Temporal.PlainTime.from(dateTime).toString(), time.toString()); - let date = Temporal.PlainDate.from('1995-12-07T03:24:30+01:00[Europe/Brussels]'); - shouldBe(time.toPlainDateTime(date).toString(), dateTime.toString()); - shouldBe(time.toJSON(), time.toString()); shouldBe(time.toLocaleString(), time.toString()); } diff --git a/Source/JavaScriptCore/runtime/TemporalPlainDateTimePrototype.cpp b/Source/JavaScriptCore/runtime/TemporalPlainDateTimePrototype.cpp index d6929d7d92a45..53c632844e1b4 100644 --- a/Source/JavaScriptCore/runtime/TemporalPlainDateTimePrototype.cpp +++ b/Source/JavaScriptCore/runtime/TemporalPlainDateTimePrototype.cpp @@ -40,7 +40,6 @@ static JSC_DECLARE_HOST_FUNCTION(temporalPlainDateTimePrototypeFuncGetISOFields) static JSC_DECLARE_HOST_FUNCTION(temporalPlainDateTimePrototypeFuncAdd); static JSC_DECLARE_HOST_FUNCTION(temporalPlainDateTimePrototypeFuncSubtract); static JSC_DECLARE_HOST_FUNCTION(temporalPlainDateTimePrototypeFuncWith); -static JSC_DECLARE_HOST_FUNCTION(temporalPlainDateTimePrototypeFuncWithPlainDate); static JSC_DECLARE_HOST_FUNCTION(temporalPlainDateTimePrototypeFuncWithPlainTime); static JSC_DECLARE_HOST_FUNCTION(temporalPlainDateTimePrototypeFuncRound); static JSC_DECLARE_HOST_FUNCTION(temporalPlainDateTimePrototypeFuncEquals); @@ -84,7 +83,6 @@ const ClassInfo TemporalPlainDateTimePrototype::s_info = { "Temporal.PlainDateTi add temporalPlainDateTimePrototypeFuncAdd DontEnum|Function 1 subtract temporalPlainDateTimePrototypeFuncSubtract DontEnum|Function 1 with temporalPlainDateTimePrototypeFuncWith DontEnum|Function 1 - withPlainDate temporalPlainDateTimePrototypeFuncWithPlainDate DontEnum|Function 1 withPlainTime temporalPlainDateTimePrototypeFuncWithPlainTime DontEnum|Function 0 round temporalPlainDateTimePrototypeFuncRound DontEnum|Function 1 equals temporalPlainDateTimePrototypeFuncEquals DontEnum|Function 1 @@ -243,22 +241,6 @@ JSC_DEFINE_HOST_FUNCTION(temporalPlainDateTimePrototypeFuncWith, (JSGlobalObject RELEASE_AND_RETURN(scope, JSValue::encode(plainDateTime->with(globalObject, asObject(temporalDateTimeLike), callFrame->argument(1)))); } -// https://tc39.es/proposal-temporal/#sec-temporal.plaindatetime.prototype.withplaindate -JSC_DEFINE_HOST_FUNCTION(temporalPlainDateTimePrototypeFuncWithPlainDate, (JSGlobalObject* globalObject, CallFrame* callFrame)) -{ - VM& vm = globalObject->vm(); - auto scope = DECLARE_THROW_SCOPE(vm); - - auto* plainDateTime = jsDynamicCast(callFrame->thisValue()); - if (!plainDateTime) - return throwVMTypeError(globalObject, scope, "Temporal.PlainDateTime.prototype.withPlainDate called on value that's not a PlainDateTime"_s); - - auto* plainDate = TemporalPlainDate::from(globalObject, callFrame->argument(0), std::nullopt); - RETURN_IF_EXCEPTION(scope, { }); - - RELEASE_AND_RETURN(scope, JSValue::encode(TemporalPlainDateTime::tryCreateIfValid(globalObject, globalObject->plainDateTimeStructure(), plainDate->plainDate(), plainDateTime->plainTime()))); -} - // https://tc39.es/proposal-temporal/#sec-temporal.plaindatetime.prototype.withplaintime JSC_DEFINE_HOST_FUNCTION(temporalPlainDateTimePrototypeFuncWithPlainTime, (JSGlobalObject* globalObject, CallFrame* callFrame)) { diff --git a/Source/JavaScriptCore/runtime/TemporalPlainTimePrototype.cpp b/Source/JavaScriptCore/runtime/TemporalPlainTimePrototype.cpp index 1ad06ddddb321..2e2eb1df98742 100644 --- a/Source/JavaScriptCore/runtime/TemporalPlainTimePrototype.cpp +++ b/Source/JavaScriptCore/runtime/TemporalPlainTimePrototype.cpp @@ -43,7 +43,6 @@ static JSC_DECLARE_HOST_FUNCTION(temporalPlainTimePrototypeFuncSince); static JSC_DECLARE_HOST_FUNCTION(temporalPlainTimePrototypeFuncRound); static JSC_DECLARE_HOST_FUNCTION(temporalPlainTimePrototypeFuncEquals); static JSC_DECLARE_HOST_FUNCTION(temporalPlainTimePrototypeFuncGetISOFields); -static JSC_DECLARE_HOST_FUNCTION(temporalPlainTimePrototypeFuncToPlainDateTime); static JSC_DECLARE_HOST_FUNCTION(temporalPlainTimePrototypeFuncToString); static JSC_DECLARE_HOST_FUNCTION(temporalPlainTimePrototypeFuncToJSON); static JSC_DECLARE_HOST_FUNCTION(temporalPlainTimePrototypeFuncToLocaleString); @@ -74,7 +73,6 @@ const ClassInfo TemporalPlainTimePrototype::s_info = { "Temporal.PlainTime"_s, & round temporalPlainTimePrototypeFuncRound DontEnum|Function 1 equals temporalPlainTimePrototypeFuncEquals DontEnum|Function 1 getISOFields temporalPlainTimePrototypeFuncGetISOFields DontEnum|Function 0 - toPlainDateTime temporalPlainTimePrototypeFuncToPlainDateTime DontEnum|Function 1 toString temporalPlainTimePrototypeFuncToString DontEnum|Function 0 toJSON temporalPlainTimePrototypeFuncToJSON DontEnum|Function 0 toLocaleString temporalPlainTimePrototypeFuncToLocaleString DontEnum|Function 0 @@ -266,22 +264,6 @@ JSC_DEFINE_HOST_FUNCTION(temporalPlainTimePrototypeFuncGetISOFields, (JSGlobalOb return JSValue::encode(fields); } -// https://tc39.es/proposal-temporal/#sec-temporal.plaintime.prototype.toplaindatetime -JSC_DEFINE_HOST_FUNCTION(temporalPlainTimePrototypeFuncToPlainDateTime, (JSGlobalObject* globalObject, CallFrame* callFrame)) -{ - VM& vm = globalObject->vm(); - auto scope = DECLARE_THROW_SCOPE(vm); - - auto* plainTime = jsDynamicCast(callFrame->thisValue()); - if (!plainTime) - return throwVMTypeError(globalObject, scope, "Temporal.PlainTime.prototype.toPlainDateTime called on value that's not a PlainTime"_s); - - auto* plainDate = TemporalPlainDate::from(globalObject, callFrame->argument(0), std::nullopt); - RETURN_IF_EXCEPTION(scope, { }); - - RELEASE_AND_RETURN(scope, JSValue::encode(TemporalPlainDateTime::tryCreateIfValid(globalObject, globalObject->plainDateTimeStructure(), plainDate->plainDate(), plainTime->plainTime()))); -} - // https://tc39.es/proposal-temporal/#sec-temporal.plaintime.prototype.tostring JSC_DEFINE_HOST_FUNCTION(temporalPlainTimePrototypeFuncToString, (JSGlobalObject* globalObject, CallFrame* callFrame)) {