diff --git a/lib/browser/api/menu.js b/lib/browser/api/menu.js index b123c8e46bbd..bd89ca319b95 100644 --- a/lib/browser/api/menu.js +++ b/lib/browser/api/menu.js @@ -99,7 +99,6 @@ Menu.prototype.getMenuItemById = function (id) { return found } -//cleaned up Menu.prototype.append = function (item) { return this.insert(this.getItemCount(), item) } @@ -268,7 +267,10 @@ function indexToInsertByPosition (items, position) { // compute new index based on query const queries = { - 'after': (index) => index += 1, + 'after': (index) => { + index += 1 + return index + }, 'endof': (index) => { if (index === -1) { items.push({id, type: 'separator'}) @@ -285,4 +287,4 @@ function indexToInsertByPosition (items, position) { return (query in queries) ? queries[query](idx) : idx } -module.exports = Menu \ No newline at end of file +module.exports = Menu