From 8e21aad444af8cfd09101af9c7dca238f4a0bdc6 Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Wed, 31 Jul 2024 20:07:30 -0500 Subject: [PATCH] chore: remove unused & undocumented function v8Util.deleteHiddenValue() (#43114) chore: remove unused v8Util.deleteHiddenValue() Its last use was removed in Nov 2020 by c8d77cae4a (#26659) Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr --- shell/common/api/electron_api_v8_util.cc | 12 ------------ typings/internal-ambient.d.ts | 1 - 2 files changed, 13 deletions(-) diff --git a/shell/common/api/electron_api_v8_util.cc b/shell/common/api/electron_api_v8_util.cc index ff5a158f94ac..c02e33489706 100644 --- a/shell/common/api/electron_api_v8_util.cc +++ b/shell/common/api/electron_api_v8_util.cc @@ -66,17 +66,6 @@ void SetHiddenValue(v8::Isolate* isolate, object->SetPrivate(context, privateKey, value); } -void DeleteHiddenValue(v8::Isolate* isolate, - v8::Local object, - v8::Local key) { - v8::Local context = isolate->GetCurrentContext(); - v8::Local privateKey = v8::Private::ForApi(isolate, key); - // Actually deleting the value would make force the object into - // dictionary mode which is unnecessarily slow. Instead, we replace - // the hidden value with "undefined". - object->SetPrivate(context, privateKey, v8::Undefined(isolate)); -} - int32_t GetObjectHash(v8::Local object) { return object->GetIdentityHash(); } @@ -113,7 +102,6 @@ void Initialize(v8::Local exports, gin_helper::Dictionary dict(context->GetIsolate(), exports); dict.SetMethod("getHiddenValue", &GetHiddenValue); dict.SetMethod("setHiddenValue", &SetHiddenValue); - dict.SetMethod("deleteHiddenValue", &DeleteHiddenValue); dict.SetMethod("getObjectHash", &GetObjectHash); dict.SetMethod("takeHeapSnapshot", &TakeHeapSnapshot); dict.SetMethod("requestGarbageCollectionForTesting", diff --git a/typings/internal-ambient.d.ts b/typings/internal-ambient.d.ts index 66ba2999b483..83adcbb28f6c 100644 --- a/typings/internal-ambient.d.ts +++ b/typings/internal-ambient.d.ts @@ -32,7 +32,6 @@ declare namespace NodeJS { interface V8UtilBinding { getHiddenValue(obj: any, key: string): T; setHiddenValue(obj: any, key: string, value: T): void; - deleteHiddenValue(obj: any, key: string): void; requestGarbageCollectionForTesting(): void; runUntilIdle(): void; triggerFatalErrorForTesting(): void;