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"); } }