Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2020-06-19 21:39:23 +0300
committerJames M Snell <jasnell@gmail.com>2020-06-25 18:33:29 +0300
commit88fb5a5c7933022de750745e51e5dc0996a1e2c4 (patch)
treeaf15b54935bd784813ccf832b6dd4c7d0b0dc596 /src/node_api.cc
parenta80000ec08a6a11f7e9e0291287fbc18357b2739 (diff)
worker: add public method for marking objects as untransferable
We currently mark a number of `ArrayBuffer`s as not transferable, including the `Buffer` pool and ones with finalizers provided by C++ addons. There is no good reason to assume that userland code might not encounter similar problems, for example when doing `ArrayBuffer` pooling similar to ours. Therefore, provide an API that lets userland code also mark objects as not transferable. PR-URL: https://github.com/nodejs/node/pull/33979 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
Diffstat (limited to 'src/node_api.cc')
-rw-r--r--src/node_api.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/node_api.cc b/src/node_api.cc
index fe24eca1b8e..314e2c57a04 100644
--- a/src/node_api.cc
+++ b/src/node_api.cc
@@ -29,7 +29,7 @@ struct node_napi_env__ : public napi_env__ {
v8::Local<v8::ArrayBuffer> ab) const override {
return ab->SetPrivate(
context(),
- node_env()->arraybuffer_untransferable_private_symbol(),
+ node_env()->untransferable_object_private_symbol(),
v8::True(isolate));
}
};