From 750962dd5a842b2da4b8a8a539b502a690c3902d Mon Sep 17 00:00:00 2001 From: Kevin <46825870+nekevss@users.noreply.github.com> Date: Mon, 29 Jan 2024 14:18:13 -0500 Subject: [PATCH] Enable Temporal tests and error message fix (#3620) --- .../src/builtins/temporal/plain_date/mod.rs | 30 +++++++++---------- test262_config.toml | 3 -- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/core/engine/src/builtins/temporal/plain_date/mod.rs b/core/engine/src/builtins/temporal/plain_date/mod.rs index c558e0e1f3..863a469c74 100644 --- a/core/engine/src/builtins/temporal/plain_date/mod.rs +++ b/core/engine/src/builtins/temporal/plain_date/mod.rs @@ -240,7 +240,7 @@ impl PlainDate { .as_object() .and_then(JsObject::downcast_ref::) .ok_or_else(|| { - JsNativeError::typ().with_message("the this object must be an instant object.") + JsNativeError::typ().with_message("the this object must be a PlainDate object.") })?; Ok(JsString::from(date.inner.calendar().identifier(context)?).into()) @@ -252,7 +252,7 @@ impl PlainDate { .as_object() .and_then(JsObject::downcast_ref::) .ok_or_else(|| { - JsNativeError::typ().with_message("the this object must be an instant object.") + JsNativeError::typ().with_message("the this object must be a PlainDate object.") })?; Ok(date.inner.contextual_year(context)?.into()) @@ -264,7 +264,7 @@ impl PlainDate { .as_object() .and_then(JsObject::downcast_ref::) .ok_or_else(|| { - JsNativeError::typ().with_message("the this object must be an instant object.") + JsNativeError::typ().with_message("the this object must be a PlainDate object.") })?; Ok(date.inner.contextual_month(context)?.into()) @@ -276,7 +276,7 @@ impl PlainDate { .as_object() .and_then(JsObject::downcast_ref::) .ok_or_else(|| { - JsNativeError::typ().with_message("the this object must be an instant object.") + JsNativeError::typ().with_message("the this object must be a PlainDate object.") })?; Ok(JsString::from(date.inner.contextual_month_code(context)?.as_str()).into()) @@ -288,7 +288,7 @@ impl PlainDate { .as_object() .and_then(JsObject::downcast_ref::) .ok_or_else(|| { - JsNativeError::typ().with_message("the this object must be an instant object.") + JsNativeError::typ().with_message("the this object must be a PlainDate object.") })?; Ok(date.inner.contextual_day(context)?.into()) @@ -300,7 +300,7 @@ impl PlainDate { .as_object() .and_then(JsObject::downcast_ref::) .ok_or_else(|| { - JsNativeError::typ().with_message("the this object must be an instant object.") + JsNativeError::typ().with_message("the this object must be a PlainDate object.") })?; Ok(date.inner.contextual_day_of_week(context)?.into()) @@ -312,7 +312,7 @@ impl PlainDate { .as_object() .and_then(JsObject::downcast_ref::) .ok_or_else(|| { - JsNativeError::typ().with_message("the this object must be an instant object.") + JsNativeError::typ().with_message("the this object must be a PlainDate object.") })?; Ok(date.inner.contextual_day_of_year(context)?.into()) @@ -324,7 +324,7 @@ impl PlainDate { .as_object() .and_then(JsObject::downcast_ref::) .ok_or_else(|| { - JsNativeError::typ().with_message("the this object must be an instant object.") + JsNativeError::typ().with_message("the this object must be a PlainDate object.") })?; Ok(date.inner.contextual_week_of_year(context)?.into()) @@ -336,7 +336,7 @@ impl PlainDate { .as_object() .and_then(JsObject::downcast_ref::) .ok_or_else(|| { - JsNativeError::typ().with_message("the this object must be an instant object.") + JsNativeError::typ().with_message("the this object must be a PlainDate object.") })?; Ok(date.inner.contextual_year_of_week(context)?.into()) @@ -348,7 +348,7 @@ impl PlainDate { .as_object() .and_then(JsObject::downcast_ref::) .ok_or_else(|| { - JsNativeError::typ().with_message("the this object must be an instant object.") + JsNativeError::typ().with_message("the this object must be a PlainDate object.") })?; Ok(date.inner.contextual_days_in_week(context)?.into()) @@ -364,7 +364,7 @@ impl PlainDate { .as_object() .and_then(JsObject::downcast_ref::) .ok_or_else(|| { - JsNativeError::typ().with_message("the this object must be an instant object.") + JsNativeError::typ().with_message("the this object must be a PlainDate object.") })?; Ok(date.inner.contextual_days_in_month(context)?.into()) @@ -376,7 +376,7 @@ impl PlainDate { .as_object() .and_then(JsObject::downcast_ref::) .ok_or_else(|| { - JsNativeError::typ().with_message("the this object must be an instant object.") + JsNativeError::typ().with_message("the this object must be a PlainDate object.") })?; Ok(date.inner.contextual_days_in_year(context)?.into()) @@ -392,7 +392,7 @@ impl PlainDate { .as_object() .and_then(JsObject::downcast_ref::) .ok_or_else(|| { - JsNativeError::typ().with_message("the this object must be an instant object.") + JsNativeError::typ().with_message("the this object must be a PlainDate object.") })?; Ok(date.inner.contextual_months_in_year(context)?.into()) @@ -404,7 +404,7 @@ impl PlainDate { .as_object() .and_then(JsObject::downcast_ref::) .ok_or_else(|| { - JsNativeError::typ().with_message("the this object must be an instant object.") + JsNativeError::typ().with_message("the this object must be a PlainDate object.") })?; Ok(date.inner.contextual_in_leap_year(context)?.into()) @@ -438,7 +438,7 @@ impl PlainDate { .as_object() .and_then(JsObject::downcast_ref::) .ok_or_else(|| { - JsNativeError::typ().with_message("the this object must be an instant object.") + JsNativeError::typ().with_message("the this object must be a PlainDate object.") })?; create_temporal_calendar(date.inner.calendar().clone(), None, context) diff --git a/test262_config.toml b/test262_config.toml index 39111cd2cc..f049ae3440 100644 --- a/test262_config.toml +++ b/test262_config.toml @@ -38,9 +38,6 @@ features = [ # https://github.com/tc39/proposal-arraybuffer-transfer "arraybuffer-transfer", - # https://github.com/tc39/proposal-temporal - "Temporal", - # https://github.com/tc39/proposal-realms "ShadowRealm",