From 0059cc3bddb5de6894dfc4f13936b08ab1babbb7 Mon Sep 17 00:00:00 2001 From: David Majda Date: Fri, 19 Aug 2016 17:20:40 +0200 Subject: [PATCH] Replace arrays.some with Array.prototype.some See #441. --- lib/compiler/asts.js | 2 +- lib/utils/arrays.js | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/lib/compiler/asts.js b/lib/compiler/asts.js index 90c6a3a..0b1ce44 100644 --- a/lib/compiler/asts.js +++ b/lib/compiler/asts.js @@ -32,7 +32,7 @@ var asts = { action: consumesExpression, sequence: function(node) { - return arrays.some(node.elements, consumes); + return node.elements.some(consumes); }, labeled: consumesExpression, diff --git a/lib/utils/arrays.js b/lib/utils/arrays.js index 2c03705..1ef8106 100644 --- a/lib/utils/arrays.js +++ b/lib/utils/arrays.js @@ -58,18 +58,6 @@ var arrays = { pluck: function(array, key) { return array.map(function (e) { return e[key]; }); - }, - - some: function(array, predicate) { - var length = array.length, i; - - for (i = 0; i < length; i++) { - if (predicate(array[i])) { - return true; - } - } - - return false; } };