diff --git a/runtime/ecma_macros.h b/runtime/ecma_macros.h index 87a8141ce3488f5716242be13b8b5a0758ecbee4..64c36f918230d2fadc17c2b29bcd99a7c730013e 100644 --- a/runtime/ecma_macros.h +++ b/runtime/ecma_macros.h @@ -145,7 +145,7 @@ static inline void UnalignedStore(T *p, T v) if (!msg->IsDate()) { \ THROW_TYPE_ERROR_AND_RETURN(thread, "Not a Date Object", JSTaggedValue::Exception()); \ } \ - JSHandle jsDate(thread, JSDate::Cast(msg->GetTaggedObject())); \ + JSHandle jsDate = JSHandle(msg); \ JSTaggedValue result = jsDate->SetDateValue(argv, code, isLocal); \ RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); \ jsDate->SetTimeValue(thread, result); \ @@ -194,7 +194,7 @@ static inline void UnalignedStore(T *p, T v) if (!msg->IsDate()) { \ THROW_TYPE_ERROR_AND_RETURN(thread, "Not a Date Object", JSTaggedValue::Exception()); \ } \ - JSHandle jsDate(thread, JSDate::Cast(msg->GetTaggedObject())); \ + JSHandle jsDate = JSHandle(msg); \ double result = jsDate->GetDateValue(jsDate->GetTimeValue().GetDouble(), code, isLocal); \ return GetTaggedDouble(result); \ }