Skip to content

Commit

Permalink
Use checkStatus to handle the return value of llvh::isArray
Browse files Browse the repository at this point in the history
`runtime_` is modified on error and restored in `checkStatus`, So it
should be safe to remove the constness and call `checkStatus` here.
  • Loading branch information
dorentus committed Aug 27, 2024
1 parent 5426026 commit f88f622
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions API/hermes/hermes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1997,9 +1997,7 @@ void HermesRuntimeImpl::setPropertyValue(

bool HermesRuntimeImpl::isArray(const jsi::Object &obj) const {
auto res = llvh::isArray(runtime_, llvh::dyn_vmcast<vm::JSObject>(phv(obj)));
if (LLVM_UNLIKELY(res == llvh::ExecutionStatus::EXCEPTION)) {
return false;
}
const_cast<HermesRuntimeImpl *>(this)->checkStatus(res.getStatus());
return *res;
}

Expand Down

0 comments on commit f88f622

Please sign in to comment.