diff --git a/driver/js/src/napi/jsc/jsc_ctx.cc b/driver/js/src/napi/jsc/jsc_ctx.cc index 25f1d9f8a83..1161e46db48 100644 --- a/driver/js/src/napi/jsc/jsc_ctx.cc +++ b/driver/js/src/napi/jsc/jsc_ctx.cc @@ -725,10 +725,7 @@ bool JSCCtx::Equals(const std::shared_ptr& lhs, const std::shared_ptr< } std::shared_ptr JSCCtx::CreateObject() { - JSClassDefinition fn_def = kJSClassDefinitionEmpty; - JSClassRef cls_ref = JSClassCreate(&fn_def); - JSObjectRef fn_obj = JSObjectMake(context_, cls_ref, nullptr); - JSClassRelease(cls_ref); + JSObjectRef fn_obj = JSObjectMake(context_, nullptr, nullptr); return std::make_shared(context_, fn_obj); } @@ -776,10 +773,7 @@ std::shared_ptr JSCCtx::CreateObject(const std::unordered_map< } std::shared_ptr JSCCtx::CreateObject(const std::unordered_map, std::shared_ptr> &object) { - JSClassDefinition cls_def = kJSClassDefinitionEmpty; - JSClassRef cls_ref = JSClassCreate(&cls_def); - JSObjectRef obj = JSObjectMake(context_, cls_ref, nullptr); - JSClassRelease(cls_ref); + JSObjectRef obj = JSObjectMake(context_, nullptr, nullptr); JSValueRef exception = nullptr; for (const auto& it : object) { string_view key;