summaryrefslogtreecommitdiff
path: root/src/node_stat_watcher.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/node_stat_watcher.cc')
-rw-r--r--src/node_stat_watcher.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/node_stat_watcher.cc b/src/node_stat_watcher.cc
index 4fa01794f6..cff92e3404 100644
--- a/src/node_stat_watcher.cc
+++ b/src/node_stat_watcher.cc
@@ -84,7 +84,8 @@ void StatWatcher::New(const FunctionCallbackInfo<Value>& args) {
void StatWatcher::Start(const FunctionCallbackInfo<Value>& args) {
CHECK_EQ(args.Length(), 3);
- StatWatcher* wrap = Unwrap<StatWatcher>(args.Holder());
+ StatWatcher* wrap;
+ ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
node::Utf8Value path(args.GetIsolate(), args[0]);
const bool persistent = args[1]->BooleanValue();
const uint32_t interval = args[2]->Uint32Value();
@@ -97,7 +98,8 @@ void StatWatcher::Start(const FunctionCallbackInfo<Value>& args) {
void StatWatcher::Stop(const FunctionCallbackInfo<Value>& args) {
- StatWatcher* wrap = Unwrap<StatWatcher>(args.Holder());
+ StatWatcher* wrap;
+ ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
Environment* env = wrap->env();
Context::Scope context_scope(env->context());
wrap->MakeCallback(env->onstop_string(), 0, nullptr);