Skip to content

Commit

Permalink
Enable Temporal tests and error message fix (#3620)
Browse files Browse the repository at this point in the history
  • Loading branch information
nekevss authored Jan 29, 2024
1 parent a32c3de commit 750962d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
30 changes: 15 additions & 15 deletions core/engine/src/builtins/temporal/plain_date/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ impl PlainDate {
.as_object()
.and_then(JsObject::downcast_ref::<Self>)
.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())
Expand All @@ -252,7 +252,7 @@ impl PlainDate {
.as_object()
.and_then(JsObject::downcast_ref::<Self>)
.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())
Expand All @@ -264,7 +264,7 @@ impl PlainDate {
.as_object()
.and_then(JsObject::downcast_ref::<Self>)
.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())
Expand All @@ -276,7 +276,7 @@ impl PlainDate {
.as_object()
.and_then(JsObject::downcast_ref::<Self>)
.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())
Expand All @@ -288,7 +288,7 @@ impl PlainDate {
.as_object()
.and_then(JsObject::downcast_ref::<Self>)
.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())
Expand All @@ -300,7 +300,7 @@ impl PlainDate {
.as_object()
.and_then(JsObject::downcast_ref::<Self>)
.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())
Expand All @@ -312,7 +312,7 @@ impl PlainDate {
.as_object()
.and_then(JsObject::downcast_ref::<Self>)
.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())
Expand All @@ -324,7 +324,7 @@ impl PlainDate {
.as_object()
.and_then(JsObject::downcast_ref::<Self>)
.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())
Expand All @@ -336,7 +336,7 @@ impl PlainDate {
.as_object()
.and_then(JsObject::downcast_ref::<Self>)
.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())
Expand All @@ -348,7 +348,7 @@ impl PlainDate {
.as_object()
.and_then(JsObject::downcast_ref::<Self>)
.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())
Expand All @@ -364,7 +364,7 @@ impl PlainDate {
.as_object()
.and_then(JsObject::downcast_ref::<Self>)
.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())
Expand All @@ -376,7 +376,7 @@ impl PlainDate {
.as_object()
.and_then(JsObject::downcast_ref::<Self>)
.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())
Expand All @@ -392,7 +392,7 @@ impl PlainDate {
.as_object()
.and_then(JsObject::downcast_ref::<Self>)
.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())
Expand All @@ -404,7 +404,7 @@ impl PlainDate {
.as_object()
.and_then(JsObject::downcast_ref::<Self>)
.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())
Expand Down Expand Up @@ -438,7 +438,7 @@ impl PlainDate {
.as_object()
.and_then(JsObject::downcast_ref::<Self>)
.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)
Expand Down
3 changes: 0 additions & 3 deletions test262_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",

Expand Down

0 comments on commit 750962d

Please sign in to comment.