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 <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
legendecas authored and danielleadams committed Jul 6, 2023
1 parent 1efa62e commit 59f22df
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 59f22df

Please sign in to comment.