Skip to content

Commit

Permalink
properly deprecate method for backwards compat
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Nov 19, 2018
1 parent cf0333f commit 06ce20a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/browser/api/app.js
Expand Up @@ -40,9 +40,14 @@ Object.assign(app, {
}
})

const nativeFn = app.getAppMetrics
const nativeGetFileIcon = app.getFileIcon
app.getFileIcon = (path, options = {}, cb) => {
return deprecate.promisify(nativeGetFileIcon.call(app, path, options), cb)
}

const nativeAppMetrics = app.getAppMetrics
app.getAppMetrics = () => {
const metrics = nativeFn.call(app)
const metrics = nativeAppMetrics.call(app)
for (const metric of metrics) {
if ('memory' in metric) {
deprecate.removeProperty(metric, 'memory')
Expand Down

0 comments on commit 06ce20a

Please sign in to comment.