diff --git a/lib/browser/api/menu.js b/lib/browser/api/menu.js index 9864e189b26c..3e56bea04b67 100644 --- a/lib/browser/api/menu.js +++ b/lib/browser/api/menu.js @@ -35,8 +35,8 @@ Menu.prototype._init = function () { }, menuWillShow: () => { // Ensure radio groups have at least one menu item seleted - for (let id in this.groupsMap) { - let found = this.groupsMap[id].find(item => item.checked) || null + for (const id in this.groupsMap) { + const found = this.groupsMap[id].find(item => item.checked) || null if (!found) v8Util.setHiddenValue(this.groupsMap[id][0], 'checked', true) } } @@ -222,11 +222,11 @@ function indexToInsertByPosition (items, position) { // compute new index based on query const queries = { - 'after': (index) => { + after: (index) => { index += 1 return index }, - 'endof': (index) => { + endof: (index) => { if (index === -1) { items.push({id, type: 'separator'}) index = items.length - 1 @@ -245,11 +245,11 @@ function indexToInsertByPosition (items, position) { // insert a new MenuItem depending on its type function insertItemByType (item, pos) { const types = { - 'normal': () => this.insertItem(pos, item.commandId, item.label), - 'checkbox': () => this.insertCheckItem(pos, item.commandId, item.label), - 'separator': () => this.insertSeparator(pos), - 'submenu': () => this.insertSubMenu(pos, item.commandId, item.label, item.submenu), - 'radio': () => { + normal: () => this.insertItem(pos, item.commandId, item.label), + checkbox: () => this.insertCheckItem(pos, item.commandId, item.label), + separator: () => this.insertSeparator(pos), + submenu: () => this.insertSubMenu(pos, item.commandId, item.label, item.submenu), + radio: () => { // Grouping radio menu items item.overrideReadOnlyProperty('groupId', generateGroupId(this.items, pos)) if (this.groupsMap[item.groupId] == null) {