diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2018-07-19 14:45:36 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-19 14:45:36 +0800 |
commit | cea685f8d98ad198f3a99d8a217183d15650959d (patch) | |
tree | 1e753254934442c5c17a49593e42b1b188726489 /lib/utils.js | |
parent | 8d4b5344f4f1d834860c407b2760fe091dedacd9 (diff) | |
download | tracifyjs-cea685f8d98ad198f3a99d8a217183d15650959d.tar.gz tracifyjs-cea685f8d98ad198f3a99d8a217183d15650959d.zip |
fix corner case in `ie8` (#3216)
fixes #3215
Diffstat (limited to 'lib/utils.js')
-rw-r--r-- | lib/utils.js | 5 |
1 files changed, 2 insertions, 3 deletions
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) { |