Skip to content

Commit

Permalink
node-api: remove unused mark_arraybuffer_as_untransferable
Browse files Browse the repository at this point in the history
napi_create_external_arraybuffer creates the arraybuffer with
node::Buffer, which already marks the buffer as untransferable.
The napi_env__::mark_arraybuffer_as_untransferable is not used
anymore.

PR-URL: #47557
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
legendecas authored and MoLow committed Jul 6, 2023
1 parent 75d7024 commit a67e5ea
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 13 deletions.
4 changes: 0 additions & 4 deletions src/js_native_api_v8.h
Expand Up @@ -66,10 +66,6 @@ struct napi_env__ {
}

virtual bool can_call_into_js() const { return true; }
virtual v8::Maybe<bool> mark_arraybuffer_as_untransferable(
v8::Local<v8::ArrayBuffer> ab) const {
return v8::Just(true);
}

static inline void HandleThrow(napi_env env, v8::Local<v8::Value> value) {
if (env->terminatedOrTerminating()) {
Expand Down
7 changes: 0 additions & 7 deletions src/node_api.cc
Expand Up @@ -35,13 +35,6 @@ bool node_napi_env__::can_call_into_js() const {
return node_env()->can_call_into_js();
}

v8::Maybe<bool> node_napi_env__::mark_arraybuffer_as_untransferable(
v8::Local<v8::ArrayBuffer> ab) const {
return ab->SetPrivate(context(),
node_env()->untransferable_object_private_symbol(),
v8::True(isolate));
}

void node_napi_env__::CallFinalizer(napi_finalize cb, void* data, void* hint) {
CallFinalizer<true>(cb, data, hint);
}
Expand Down
2 changes: 0 additions & 2 deletions src/node_api_internals.h
Expand Up @@ -13,8 +13,6 @@ struct node_napi_env__ : public napi_env__ {
const std::string& module_filename);

bool can_call_into_js() const override;
v8::Maybe<bool> mark_arraybuffer_as_untransferable(
v8::Local<v8::ArrayBuffer> ab) const override;
void CallFinalizer(napi_finalize cb, void* data, void* hint) override;
template <bool enforceUncaughtExceptionPolicy>
void CallFinalizer(napi_finalize cb, void* data, void* hint);
Expand Down

0 comments on commit a67e5ea

Please sign in to comment.