Remove unneeded [].indexOf fallback

This commit is contained in:
Kevin Sawicki 2016-01-15 09:24:53 -08:00
parent 1b0da44f38
commit c2d473cf65
3 changed files with 3 additions and 3 deletions

View file

@ -4,7 +4,7 @@ const binding = process.atomBinding('dialog');
const v8Util = process.atomBinding('v8_util'); const v8Util = process.atomBinding('v8_util');
var slice = [].slice; 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 = { var fileDialogProperties = {
openFile: 1 << 0, openFile: 1 << 0,

View file

@ -2,7 +2,7 @@ const ipcRenderer = require('electron').ipcRenderer;
const nativeImage = require('electron').nativeImage; const nativeImage = require('electron').nativeImage;
var nextId = 0; 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() { var getNextId = function() {
return ++nextId; return ++nextId;

View file

@ -4,7 +4,7 @@ const v8Util = process.atomBinding('v8_util');
const callbacksRegistry = new CallbacksRegistry; 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. // Check for circular reference.
var isCircular = function(field, visited) { var isCircular = function(field, visited) {