From ad17cfd1d71ff84d5cc205a4ba62154c36487946 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hanno=20J=2E=20G=C3=B6decke?= Date: Sun, 11 Sep 2022 21:51:10 +0200 Subject: [PATCH] fix: compatibility with RN 0.70 --- cpp/JSIBox2dBody.h | 3 +-- cpp/JSIBox2dBodyDef.h | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/cpp/JSIBox2dBody.h b/cpp/JSIBox2dBody.h index 05e5580..de378cb 100644 --- a/cpp/JSIBox2dBody.h +++ b/cpp/JSIBox2dBody.h @@ -42,8 +42,7 @@ namespace Box2d { } } - jsi::detail::throwJSError(runtime, "Unsupported shape type"); - return jsi::Value::undefined(); + throw jsi::JSError(runtime, "Unsupported shape type"); } JSI_HOST_FUNCTION(CreateFixture2) { diff --git a/cpp/JSIBox2dBodyDef.h b/cpp/JSIBox2dBodyDef.h index dbe1eea..c5e1f11 100644 --- a/cpp/JSIBox2dBodyDef.h +++ b/cpp/JSIBox2dBodyDef.h @@ -25,7 +25,7 @@ namespace Box2d { if(value.isObject() && value.asObject(runtime).isHostObject(runtime)) { getObject()->position = *JSIBox2dVec2::fromValue(runtime, value); } else { - jsi::detail::throwJSError(runtime, "Parameter was not recognized as b2vec2."); + throw jsi::JSError(runtime, "Parameter was not recognized as b2vec2."); } } JSI_PROPERTY_SET(angle) { @@ -40,7 +40,7 @@ namespace Box2d { } else if (typeNum == 2) { getObject()->type = b2_dynamicBody; } else { - jsi::detail::throwJSError(runtime, "Only type 0 (static), 1 (kinematic), 2 (dynamic) are supported"); + throw jsi::JSError(runtime, "Only type 0 (static), 1 (kinematic), 2 (dynamic) are supported"); } }