summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2017-05-08 14:25:12 -0500
committerMike Greiling <mike@pixelcog.com>2017-05-08 17:40:24 -0500
commitf6d214e17e134e0cb868eb9cff021d8cfc1e88bf (patch)
tree171262e1f9ce052cd79c71d1f31f254efa211991
parente0c6ea8798ccc090224164223fbe32818c47336d (diff)
downloadgitlab-ce-remove-needless-bind-polyfills.tar.gz
remove unnecessary indexOf polyfillsremove-needless-bind-polyfills
-rw-r--r--app/assets/javascripts/gl_dropdown.js7
-rw-r--r--app/assets/javascripts/merge_request_widget.js4
-rw-r--r--app/assets/javascripts/new_branch_form.js4
3 files changed, 6 insertions, 9 deletions
diff --git a/app/assets/javascripts/gl_dropdown.js b/app/assets/javascripts/gl_dropdown.js
index 7ebc0501e84..2eee989bffe 100644
--- a/app/assets/javascripts/gl_dropdown.js
+++ b/app/assets/javascripts/gl_dropdown.js
@@ -1,8 +1,7 @@
/* eslint-disable func-names, space-before-function-paren, no-var, one-var, one-var-declaration-per-line, prefer-rest-params, max-len, vars-on-top, wrap-iife, no-unused-vars, quotes, no-shadow, no-cond-assign, prefer-arrow-callback, no-return-assign, no-else-return, camelcase, comma-dangle, no-lonely-if, guard-for-in, no-restricted-syntax, consistent-return, prefer-template, no-param-reassign, no-loop-func, no-mixed-operators */
/* global fuzzaldrinPlus */
-var GitLabDropdown, GitLabDropdownFilter, GitLabDropdownRemote,
- indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i += 1) { if (i in this && this[i] === item) return i; } return -1; };
+var GitLabDropdown, GitLabDropdownFilter, GitLabDropdownRemote;
GitLabDropdownFilter = (function() {
var ARROW_KEY_CODES, BLUR_KEYCODES, HAS_VALUE_CLASS;
@@ -626,8 +625,8 @@ GitLabDropdown = (function() {
};
GitLabDropdown.prototype.highlightTextMatches = function(text, term) {
- var occurrences;
- occurrences = fuzzaldrinPlus.match(text, term);
+ const occurrences = fuzzaldrinPlus.match(text, term);
+ const indexOf = [].indexOf;
return text.split('').map(function(character, i) {
if (indexOf.call(occurrences, i) !== -1) {
return "<b>" + character + "</b>";
diff --git a/app/assets/javascripts/merge_request_widget.js b/app/assets/javascripts/merge_request_widget.js
index 6f6ae9bde92..3f976680b9d 100644
--- a/app/assets/javascripts/merge_request_widget.js
+++ b/app/assets/javascripts/merge_request_widget.js
@@ -7,8 +7,6 @@ import './smart_interval';
import MiniPipelineGraph from './mini_pipeline_graph_dropdown';
((global) => {
- var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i += 1) { if (i in this && this[i] === item) return i; } return -1; };
-
const DEPLOYMENT_TEMPLATE = `<div class="mr-widget-heading" id="<%- id %>">
<div class="ci_widget ci-success">
<%= ci_success_icon %>
@@ -258,7 +256,7 @@ import MiniPipelineGraph from './mini_pipeline_graph_dropdown';
let stateClass = 'btn-danger';
if (!hasCi) {
stateClass = 'btn-create';
- } else if (indexOf.call(allowed_states, state) !== -1) {
+ } else if (allowed_states.indexOf(state) !== -1) {
switch (state) {
case "failed":
case "canceled":
diff --git a/app/assets/javascripts/new_branch_form.js b/app/assets/javascripts/new_branch_form.js
index c4733253af8..9d614cdee3a 100644
--- a/app/assets/javascripts/new_branch_form.js
+++ b/app/assets/javascripts/new_branch_form.js
@@ -1,7 +1,5 @@
/* eslint-disable func-names, space-before-function-paren, no-var, one-var, prefer-rest-params, max-len, vars-on-top, wrap-iife, consistent-return, comma-dangle, one-var-declaration-per-line, quotes, no-return-assign, prefer-arrow-callback, prefer-template, no-shadow, no-else-return, max-len, object-shorthand */
(function() {
- var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i += 1) { if (i in this && this[i] === item) return i; } return -1; };
-
this.NewBranchForm = (function() {
function NewBranchForm(form, availableRefs) {
this.validate = this.validate.bind(this);
@@ -94,6 +92,8 @@
NewBranchForm.prototype.validate = function() {
var errorMessage, errors, formatter, unique, validator;
+ const indexOf = [].indexOf;
+
this.branchNameError.empty();
unique = function(values, value) {
if (indexOf.call(values, value) === -1) {