diff --git a/src/node_api.cc b/src/node_api.cc index ef02bd47f6e549..f0dbe1fb717486 100644 --- a/src/node_api.cc +++ b/src/node_api.cc @@ -2020,8 +2020,8 @@ napi_status napi_wrap(napi_env env, // Insert the wrapper into the object's prototype chain. v8::Local proto = obj->GetPrototype(); - wrapper->SetPrototype(proto); - obj->SetPrototype(wrapper); + CHECK(wrapper->SetPrototype(context, proto).FromJust()); + CHECK(obj->SetPrototype(context, wrapper).FromJust()); if (result != nullptr) { // The returned reference should be deleted via napi_delete_reference()