From cea685f8d98ad198f3a99d8a217183d15650959d Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Thu, 19 Jul 2018 14:45:36 +0800 Subject: fix corner case in `ie8` (#3216) fixes #3215 --- lib/utils.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/utils.js') diff --git a/lib/utils.js b/lib/utils.js index 4a61623a..40b65e2a 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -172,9 +172,8 @@ function string_template(text, props) { } function remove(array, el) { - for (var i = array.length; --i >= 0;) { - if (array[i] === el) array.splice(i, 1); - } + var index = array.indexOf(el); + if (index >= 0) array.splice(index, 1); } function makePredicate(words) { -- cgit v1.2.3