From fce14215cc7c6287ef7c7bb20192eb7cb42d6e83 Mon Sep 17 00:00:00 2001 From: Nazarov Konstantin Date: Fri, 3 Mar 2023 13:45:45 +0300 Subject: [PATCH] assert callable function object and no exception in ExecuteInEnv Signed-off-by: Nazarov Konstantin --- runtime/interpreter/interpreter-inl.h | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/runtime/interpreter/interpreter-inl.h b/runtime/interpreter/interpreter-inl.h index a89db3460..b96e532de 100644 --- a/runtime/interpreter/interpreter-inl.h +++ b/runtime/interpreter/interpreter-inl.h @@ -145,18 +145,10 @@ JSTaggedValue EcmaInterpreter::ExecuteInvoke(EcmaRuntimeCallInfo *info, JSTagged JSTaggedValue EcmaInterpreter::ExecuteInEnv(EcmaRuntimeCallInfo *info, JSTaggedValue fn_object) { - JSThread *thread = info->GetThread(); - - if (UNLIKELY(thread->HasPendingException())) { // TODO(vpukhov): replace with assert - return JSTaggedValue::Undefined(); - } + ASSERT(fn_object.IsCallable()); - if (UNLIKELY(!fn_object.IsCallable())) { // TODO(vpukhov): replace with assert - JSHandle error = - thread->GetEcmaVM()->GetFactory()->GetJSError(ErrorType::TYPE_ERROR, "is not callable"); - thread->SetException(error.GetTaggedValue()); - return JSTaggedValue::Exception(); - } + JSThread *thread = info->GetThread(); + ASSERT(!thread->HasPendingException()); Method *method = ECMAObject::Cast(fn_object.GetHeapObject())->GetCallTarget(); -- Gitee