chore: remove unused deprecate.fnToProperty() (#24069)
This commit is contained in:
parent
9c7d73c6d6
commit
673169a7ba
3 changed files with 0 additions and 42 deletions
|
@ -76,23 +76,6 @@ const deprecate: ElectronInternal.DeprecationUtil = {
|
|||
});
|
||||
},
|
||||
|
||||
// deprecate a getter/setter function pair in favor of a property
|
||||
fnToProperty: (prototype: any, prop: string, getter: string, setter?: string) => {
|
||||
const withWarnOnce = function (obj: any, key: any, oldName: string, newName: string) {
|
||||
const warn = warnOnce(oldName, newName);
|
||||
const method = obj[key];
|
||||
return function (this: any, ...args: any) {
|
||||
warn();
|
||||
return method.apply(this, args);
|
||||
};
|
||||
};
|
||||
|
||||
prototype[getter.substr(1)] = withWarnOnce(prototype, getter, `${getter.substr(1)} function`, `${prop} property`);
|
||||
if (setter) {
|
||||
prototype[setter.substr(1)] = withWarnOnce(prototype, setter, `${setter.substr(1)} function`, `${prop} property`);
|
||||
}
|
||||
},
|
||||
|
||||
// remove a property with no replacement
|
||||
removeProperty: (o, removedName, onlyForValues) => {
|
||||
// if the property's already been removed, warn about it
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue