From 33fb58e98fa403e326f6ae06aaddc4fb784f5f3d Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sun, 10 Sep 2017 05:05:48 +0200 Subject: [PATCH] src: rename string id for `_onclose` to match This is just a tiny change that moves registers `'_onclose'` string under that name and introduces `'onclose'` for later use. PR-URL: https://github.com/ayojs/ayo/pull/94 Reviewed-By: Timothy Gu --- src/env.h | 3 ++- src/handle_wrap.cc | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) 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();