summaryrefslogtreecommitdiff
path: root/test/addons/async-hello-world
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2018-11-10 16:35:38 +0100
committerAnna Henningsen <anna@addaleax.net>2018-11-13 15:25:46 +0100
commitfcd7a7242890b30c3c143255234bdfe1855999b6 (patch)
tree61755e9f66370108c31304a871f93aa8b6694ade /test/addons/async-hello-world
parent6ae6383fdc40c1fe799a8ff600e60ed58366f798 (diff)
downloadandroid-node-v8-fcd7a7242890b30c3c143255234bdfe1855999b6.tar.gz
android-node-v8-fcd7a7242890b30c3c143255234bdfe1855999b6.tar.bz2
android-node-v8-fcd7a7242890b30c3c143255234bdfe1855999b6.zip
async_hooks: add HandleScopes to C++ embedder/addon API
Add `HandleScope`s to the public C++ API for embedders/addons, since these methods create V8 handles that should not leak into the outer scopes. In particular, for some of the methods it was not clear from the function signatures that these functions previously needed to be invoked with a `HandleScope`. PR-URL: https://github.com/nodejs/node/pull/24285 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Diffstat (limited to 'test/addons/async-hello-world')
-rw-r--r--test/addons/async-hello-world/binding.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/addons/async-hello-world/binding.cc b/test/addons/async-hello-world/binding.cc
index 1bf94ddd1d..ff899628c4 100644
--- a/test/addons/async-hello-world/binding.cc
+++ b/test/addons/async-hello-world/binding.cc
@@ -57,6 +57,8 @@ void AfterAsync(uv_work_t* r) {
global, 2, argv).ToLocalChecked();
}
+ // None of the following operations should allocate handles into this scope.
+ v8::SealHandleScope seal_handle_scope(isolate);
// cleanup
node::EmitAsyncDestroy(isolate, req->context);
req->callback.Reset();