summaryrefslogtreecommitdiff
path: root/src/stream_base-inl.h
diff options
context:
space:
mode:
authorAndreas Madsen <amwebdk@gmail.com>2017-11-22 18:41:00 +0100
committerAndreas Madsen <amwebdk@gmail.com>2017-12-19 18:04:52 +0100
commit3b8da4cbe8a7f36fcd8892c6676a55246ba8c3be (patch)
tree1afc84002d1716f4acd28126df214127e0262c3c /src/stream_base-inl.h
parent0784b0440c05464f79b857f7d8698fcc953d3fb3 (diff)
downloadandroid-node-v8-3b8da4cbe8a7f36fcd8892c6676a55246ba8c3be.tar.gz
android-node-v8-3b8da4cbe8a7f36fcd8892c6676a55246ba8c3be.tar.bz2
android-node-v8-3b8da4cbe8a7f36fcd8892c6676a55246ba8c3be.zip
async_hooks: use scope for defaultTriggerAsyncId
Previously the getter would mutate the kDefaultTriggerAsncId value. This refactor changes the setter to bind the current kDefaultTriggerAsncId to a scope, such that the getter doesn't have to mutate its own value. PR-URL: https://github.com/nodejs/node/pull/17273 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/stream_base-inl.h')
-rw-r--r--src/stream_base-inl.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/stream_base-inl.h b/src/stream_base-inl.h
index cc89a11bac..cdcff67cc5 100644
--- a/src/stream_base-inl.h
+++ b/src/stream_base-inl.h
@@ -143,7 +143,8 @@ void StreamBase::JSMethod(const FunctionCallbackInfo<Value>& args) {
if (!wrap->IsAlive())
return args.GetReturnValue().Set(UV_EINVAL);
- AsyncHooks::InitScope init_scope(handle->env(), handle->get_async_id());
+ AsyncHooks::DefaultTriggerAsyncIdScope trigger_scope(
+ handle->env(), handle->get_async_id());
args.GetReturnValue().Set((wrap->*Method)(args));
}