Skip to content

Commit 028e582

Browse files
tsaichienfacebook-github-bot
authored andcommitted
Make jsi::Object constructor explicit (#53521)
Summary: Pull Request resolved: #53521 Make `jsi::Object` constructor explicit, so its creation is explicit and intentional. This prevents any sad foot-gun of constructing an Object implicitly from a Runtime, which is certainly not a JS object. Changelog: [Internal] Reviewed By: avp Differential Revision: D81274439 fbshipit-source-id: 5a9d9907f9deff7625dcff9c1072eb135ab7840e
1 parent 1ad2ec0 commit 028e582

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • packages/react-native/ReactCommon/jsi/jsi

packages/react-native/ReactCommon/jsi/jsi/jsi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@ class JSI_EXPORT Object : public Pointer {
914914
Object& operator=(Object&& other) = default;
915915

916916
/// Creates a new Object instance, like '{}' in JS.
917-
Object(Runtime& runtime) : Object(runtime.createObject()) {}
917+
explicit Object(Runtime& runtime) : Object(runtime.createObject()) {}
918918

919919
static Object createFromHostObject(
920920
Runtime& runtime,

0 commit comments

Comments
 (0)