summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2020-12-08 11:59:03 +0100
committerNode.js GitHub Bot <github-bot@iojs.org>2020-12-13 15:03:19 +0000
commitd313bf7d471cac082d2122b8aaca6a1cb2b3baab (patch)
treec2f594222b35e50a8b8aa22e1b45ded83483d10f /test
parent7069d223431a527aa7355d91c55241799057ae87 (diff)
downloadios-node-v8-d313bf7d471cac082d2122b8aaca6a1cb2b3baab.tar.gz
ios-node-v8-d313bf7d471cac082d2122b8aaca6a1cb2b3baab.tar.bz2
ios-node-v8-d313bf7d471cac082d2122b8aaca6a1cb2b3baab.zip
src: add way to get IsolateData and allocator from Environment
Add a way to get the current `IsolateData*` and, from it, the current Node.js `ArrayBufferAllocator` if there is one. This can be useful for re-using either one of these structures as an embedder. PR-URL: https://github.com/nodejs/node/pull/36441 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/cctest/test_environment.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/cctest/test_environment.cc b/test/cctest/test_environment.cc
index dcd59a22d3..baa03a5899 100644
--- a/test/cctest/test_environment.cc
+++ b/test/cctest/test_environment.cc
@@ -586,6 +586,9 @@ TEST_F(NodeZeroIsolateTestFixture, CtrlCWithOnlySafeTerminationTest) {
{}),
node::FreeEnvironment};
CHECK(environment);
+ EXPECT_EQ(node::GetEnvironmentIsolateData(environment.get()),
+ isolate_data.get());
+ EXPECT_EQ(node::GetArrayBufferAllocator(isolate_data.get()), nullptr);
v8::Local<v8::Value> main_ret =
node::LoadEnvironment(environment.get(),