Skip to content

Commit 69baae2

Browse files
anonrigaduh95
authored andcommitted
src: remove unused detachArrayBuffer method
PR-URL: #58055 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
1 parent aa35fd8 commit 69baae2

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

src/node_buffer.cc

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,20 +1261,6 @@ void GetZeroFillToggle(const FunctionCallbackInfo<Value>& args) {
12611261
args.GetReturnValue().Set(Uint32Array::New(ab, 0, 1));
12621262
}
12631263

1264-
void DetachArrayBuffer(const FunctionCallbackInfo<Value>& args) {
1265-
Environment* env = Environment::GetCurrent(args);
1266-
if (args[0]->IsArrayBuffer()) {
1267-
Local<ArrayBuffer> buf = args[0].As<ArrayBuffer>();
1268-
if (buf->IsDetachable()) {
1269-
std::shared_ptr<BackingStore> store = buf->GetBackingStore();
1270-
if (buf->Detach(Local<Value>()).IsNothing()) {
1271-
return;
1272-
}
1273-
args.GetReturnValue().Set(ArrayBuffer::New(env->isolate(), store));
1274-
}
1275-
}
1276-
}
1277-
12781264
static void Btoa(const FunctionCallbackInfo<Value>& args) {
12791265
CHECK_EQ(args.Length(), 1);
12801266
Environment* env = Environment::GetCurrent(args);
@@ -1564,7 +1550,6 @@ void Initialize(Local<Object> target,
15641550
&fast_index_of_number);
15651551
SetMethodNoSideEffect(context, target, "indexOfString", IndexOfString);
15661552

1567-
SetMethod(context, target, "detachArrayBuffer", DetachArrayBuffer);
15681553
SetMethod(context, target, "copyArrayBuffer", CopyArrayBuffer);
15691554

15701555
SetMethod(context, target, "swap16", Swap16);
@@ -1674,7 +1659,6 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
16741659
registry->Register(StringWrite<UTF8>);
16751660
registry->Register(GetZeroFillToggle);
16761661

1677-
registry->Register(DetachArrayBuffer);
16781662
registry->Register(CopyArrayBuffer);
16791663

16801664
registry->Register(Atob);

0 commit comments

Comments
 (0)