refactor: deprecation handling apis (#14615)

This commit is contained in:
Shelley Vohr 2018-09-13 21:39:00 -07:00 committed by GitHub
parent 7e5815c180
commit 89148bcf8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 142 additions and 161 deletions

View file

@ -60,9 +60,13 @@ Object.assign(app, {
const nativeFn = app.getAppMetrics
app.getAppMetrics = () => {
deprecate.removeProperty(nativeFn, 'privateBytes')
deprecate.removeProperty(nativeFn, 'sharedBytes')
return nativeFn.call(app)
let metrics = nativeFn.call(app)
for (const metric of metrics) {
deprecate.removeProperty(metric, 'memory', true)
if ('memory' in metric) {
deprecate.removeProperty(metric, 'memory')
}
}
}
app.isPackaged = (() => {