diff options
author | Darshan Sen <darshan.sen@postman.com> | 2021-08-15 11:00:35 +0530 |
---|---|---|
committer | Node.js GitHub Bot <github-bot@iojs.org> | 2021-08-21 06:53:50 +0000 |
commit | 16853c9d551275dce5390e10a1f1704e9954430b (patch) | |
tree | 657deb67cebb11132449f78999bf2ce844fe9e78 /src/node_api.cc | |
parent | 248f4c376444d0202f1d08f039c59485d6aea2e9 (diff) | |
download | node-new-16853c9d551275dce5390e10a1f1704e9954430b.tar.gz |
src: add a constructor overload for CallbackScope
This overload accepts the current Environment* as an argument, unlike
the other constructor, which accepts an Isolate*. This is useful because
we can pass the current Environment* directly instead of recomputing it
from the Isolate* inside the constructor.
Signed-off-by: Darshan Sen <darshan.sen@postman.com>
PR-URL: https://github.com/nodejs/node/pull/39768
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Diffstat (limited to 'src/node_api.cc')
-rw-r--r-- | src/node_api.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/node_api.cc b/src/node_api.cc index 8304ccb7e8..b1b8507350 100644 --- a/src/node_api.cc +++ b/src/node_api.cc @@ -539,7 +539,7 @@ class AsyncContext { class CallbackScope : public node::CallbackScope { public: explicit CallbackScope(AsyncContext* async_context) - : node::CallbackScope(async_context->node_env()->isolate(), + : node::CallbackScope(async_context->node_env(), async_context->resource_.Get( async_context->node_env()->isolate()), async_context->async_context()) {} |