diff --git a/src/env.h b/src/env.h index 2672ab7fb7..421e526be9 100644 --- a/src/env.h +++ b/src/env.h @@ -113,7 +113,8 @@ class ModuleWrap; V(channel_string, "channel") \ V(constants_string, "constants") \ V(oncertcb_string, "oncertcb") \ - V(onclose_string, "_onclose") \ + V(_onclose_string, "_onclose") \ + V(onclose_string, "onclose") \ V(code_string, "code") \ V(configurable_string, "configurable") \ V(cwd_string, "cwd") \ diff --git a/src/handle_wrap.cc b/src/handle_wrap.cc index 561927505b..e23bbe41e3 100644 --- a/src/handle_wrap.cc +++ b/src/handle_wrap.cc @@ -79,7 +79,7 @@ void HandleWrap::Close(v8::Local close_callback) { state_ = kClosing; if (!close_callback.IsEmpty() && close_callback->IsFunction()) { - object()->Set(env()->context(), env()->onclose_string(), close_callback) + object()->Set(env()->context(), env()->_onclose_string(), close_callback) .FromJust(); state_ = kClosingWithCallback; } @@ -132,7 +132,7 @@ void HandleWrap::OnClose(uv_handle_t* handle) { wrap->OnClose(); if (have_close_callback) - wrap->MakeCallback(env->onclose_string(), 0, nullptr); + wrap->MakeCallback(env->_onclose_string(), 0, nullptr); ClearWrap(wrap->object()); wrap->persistent().Reset();