diff options
author | Javier Gonzalez <xaviergonz@gmail.com> | 2018-03-04 19:28:38 +0100 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2018-07-16 01:44:21 +0200 |
commit | fb87d8aa12c8e891857c46e632d37970533f4e92 (patch) | |
tree | fc8105bd274f8401a4e0b14ddb4c5b6784b6517a /src/env-inl.h | |
parent | d279a8fceea91a0a27158867570d8f203cb372a3 (diff) | |
download | android-node-v8-fb87d8aa12c8e891857c46e632d37970533f4e92.tar.gz android-node-v8-fb87d8aa12c8e891857c46e632d37970533f4e92.tar.bz2 android-node-v8-fb87d8aa12c8e891857c46e632d37970533f4e92.zip |
src: fix async hooks crashing when there is no node context
PR-URL: https://github.com/nodejs/node/pull/19134
Fixes: https://github.com/nodejs/node/issues/19104
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Diffstat (limited to 'src/env-inl.h')
-rw-r--r-- | src/env-inl.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/env-inl.h b/src/env-inl.h index fccd45070c..a294066bb5 100644 --- a/src/env-inl.h +++ b/src/env-inl.h @@ -282,6 +282,9 @@ inline void Environment::AssignToContext(v8::Local<v8::Context> context, const ContextInfo& info) { context->SetAlignedPointerInEmbedderData( ContextEmbedderIndex::kEnvironment, this); + // Used by EnvPromiseHook to know that we are on a node context. + context->SetAlignedPointerInEmbedderData( + ContextEmbedderIndex::kContextTag, Environment::kNodeContextTagPtr); #if HAVE_INSPECTOR inspector_agent()->ContextCreated(context, info); #endif // HAVE_INSPECTOR |