chore: remove unused deprecate.fnToProperty() (#24069)

This commit is contained in:
Milan Burda 2020-06-16 03:59:04 +02:00 committed by GitHub
parent 9c7d73c6d6
commit 673169a7ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 42 deletions

View file

@ -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