Skip to content

Commit

Permalink
src: rename string id for _onclose to match
Browse files Browse the repository at this point in the history
This is just a tiny change that moves registers `'_onclose'` string
under that name and introduces `'onclose'` for later use.

PR-URL: ayojs#94
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
  • Loading branch information
addaleax committed Oct 4, 2017
1 parent df82c20 commit 33fb58e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/env.h
Original file line number Diff line number Diff line change
Expand Up @@ -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") \
Expand Down
4 changes: 2 additions & 2 deletions src/handle_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void HandleWrap::Close(v8::Local<v8::Value> 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;
}
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 33fb58e

Please sign in to comment.