Skip to content

Commit

Permalink
fix: compatibility with RN 0.70
Browse files Browse the repository at this point in the history
  • Loading branch information
hannojg committed Sep 11, 2022
1 parent 68837d9 commit ad17cfd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions cpp/JSIBox2dBody.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions cpp/JSIBox2dBodyDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace Box2d {
if(value.isObject() && value.asObject(runtime).isHostObject<JSIBox2dVec2>(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) {
Expand All @@ -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");
}
}

Expand Down

0 comments on commit ad17cfd

Please sign in to comment.