Remove linter warnings

This commit is contained in:
Kevin Sawicki 2017-02-27 10:40:00 -08:00
parent 9272582bd6
commit 9bdca3bbfb
2 changed files with 10 additions and 8 deletions

View file

@ -213,11 +213,13 @@ BrowserWindow.prototype.setTouchBar = function (touchBar) {
this._setTouchBar(touchBar.toJSON()) this._setTouchBar(touchBar.toJSON())
} }
touchBar._owner = this touchBar._owner = this
touchBar.items.forEach((item) => { item._owner = this; }) touchBar.items.forEach((item) => {
item._owner = this
})
} }
BrowserWindow.prototype._updateTouchBarItem = function (itemID) { BrowserWindow.prototype._updateTouchBarItem = function (itemID) {
this._refreshTouchBarItem(itemID); this._refreshTouchBarItem(itemID)
} }
module.exports = BrowserWindow module.exports = BrowserWindow

View file

@ -46,12 +46,12 @@ class TouchBarItem {
updateConfig (newConfig) { updateConfig (newConfig) {
if (!this._owner) { if (!this._owner) {
throw new Error('Cannot call methods on TouchBarItems without assigning to a BrowserWindow'); throw new Error('Cannot call methods on TouchBarItems without assigning to a BrowserWindow')
} }
const dupConfig = Object.assign({}, newConfig); const dupConfig = Object.assign({}, newConfig)
delete dupConfig.id; delete dupConfig.id
Object.assign(this.config, dupConfig); Object.assign(this.config, dupConfig)
this._owner._updateTouchBarItem(this.toJSON()); this._owner._updateTouchBarItem(this.toJSON())
} }
toJSON () { toJSON () {