Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace custom function with Object.values() #11836

Merged
merged 1 commit into from Feb 6, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 2 additions & 7 deletions lib/browser/chrome-extension.js
Expand Up @@ -7,11 +7,6 @@ const fs = require('fs')
const path = require('path')
const url = require('url')

// TODO(zcbenz): Remove this when we have Object.values().
const objectValues = function (object) {
return Object.keys(object).map(function (key) { return object[key] })
}

// Mapping between extensionId(hostname) and manifest.
const manifestMap = {} // extensionId => manifest
const manifestNameMap = {} // name => manifest
Expand Down Expand Up @@ -110,7 +105,7 @@ const removeBackgroundPages = function (manifest) {
}

const sendToBackgroundPages = function (...args) {
for (const page of objectValues(backgroundPages)) {
for (const page of Object.values(backgroundPages)) {
page.webContents.sendToAll(...args)
}
}
Expand Down Expand Up @@ -297,7 +292,7 @@ app.on('web-contents-created', function (event, webContents) {

hookWebContentsEvents(webContents)
webContents.on('devtools-opened', function () {
loadDevToolsExtensions(webContents, objectValues(manifestMap))
loadDevToolsExtensions(webContents, Object.values(manifestMap))
})
})

Expand Down