diff --git a/atom/browser/api/lib/dialog.js b/atom/browser/api/lib/dialog.js index b77773be2096..94d78634b532 100644 --- a/atom/browser/api/lib/dialog.js +++ b/atom/browser/api/lib/dialog.js @@ -4,7 +4,7 @@ const binding = process.atomBinding('dialog'); const v8Util = process.atomBinding('v8_util'); var slice = [].slice; -var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; +var indexOf = [].indexOf; var fileDialogProperties = { openFile: 1 << 0, diff --git a/atom/renderer/api/lib/desktop-capturer.js b/atom/renderer/api/lib/desktop-capturer.js index c445bfecbe1b..921ede582544 100644 --- a/atom/renderer/api/lib/desktop-capturer.js +++ b/atom/renderer/api/lib/desktop-capturer.js @@ -2,7 +2,7 @@ const ipcRenderer = require('electron').ipcRenderer; const nativeImage = require('electron').nativeImage; var nextId = 0; -var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; +var indexOf = [].indexOf; var getNextId = function() { return ++nextId; diff --git a/atom/renderer/api/lib/remote.js b/atom/renderer/api/lib/remote.js index c9b823b3b397..a91a71556dd7 100644 --- a/atom/renderer/api/lib/remote.js +++ b/atom/renderer/api/lib/remote.js @@ -4,7 +4,7 @@ const v8Util = process.atomBinding('v8_util'); const callbacksRegistry = new CallbacksRegistry; -var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; +var indexOf = [].indexOf; // Check for circular reference. var isCircular = function(field, visited) {