diff --git a/runtime/interpreter/interpreter-inl.h b/runtime/interpreter/interpreter-inl.h index a89db3460053fbe08418897303af7952b54cc646..b96e532de2e2333b18ce3b0083bb975037e1ccfc 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();