diff --git a/lib/compiler/asts.js b/lib/compiler/asts.js index 7dac649..90c6a3a 100644 --- a/lib/compiler/asts.js +++ b/lib/compiler/asts.js @@ -26,7 +26,7 @@ var asts = { named: consumesExpression, choice: function(node) { - return arrays.every(node.alternatives, consumes); + return node.alternatives.every(consumes); }, action: consumesExpression, diff --git a/lib/compiler/passes/report-infinite-recursion.js b/lib/compiler/passes/report-infinite-recursion.js index 1230a2f..6623a8b 100644 --- a/lib/compiler/passes/report-infinite-recursion.js +++ b/lib/compiler/passes/report-infinite-recursion.js @@ -28,7 +28,7 @@ function reportInfiniteRecursion(ast) { }, sequence: function(node) { - arrays.every(node.elements, function(element) { + node.elements.every(function(element) { check(element); return !asts.alwaysConsumesOnSuccess(ast, element); diff --git a/lib/utils/arrays.js b/lib/utils/arrays.js index 3b687aa..2c03705 100644 --- a/lib/utils/arrays.js +++ b/lib/utils/arrays.js @@ -60,18 +60,6 @@ var arrays = { return array.map(function (e) { return e[key]; }); }, - every: function(array, predicate) { - var length = array.length, i; - - for (i = 0; i < length; i++) { - if (!predicate(array[i])) { - return false; - } - } - - return true; - }, - some: function(array, predicate) { var length = array.length, i;