Replace arrays.every with Array.prototype.every

See #441.
redux
David Majda 8 years ago
parent 5f65de92bc
commit d162fe1cfc

@ -26,7 +26,7 @@ var asts = {
named: consumesExpression, named: consumesExpression,
choice: function(node) { choice: function(node) {
return arrays.every(node.alternatives, consumes); return node.alternatives.every(consumes);
}, },
action: consumesExpression, action: consumesExpression,

@ -28,7 +28,7 @@ function reportInfiniteRecursion(ast) {
}, },
sequence: function(node) { sequence: function(node) {
arrays.every(node.elements, function(element) { node.elements.every(function(element) {
check(element); check(element);
return !asts.alwaysConsumesOnSuccess(ast, element); return !asts.alwaysConsumesOnSuccess(ast, element);

@ -60,18 +60,6 @@ var arrays = {
return array.map(function (e) { return e[key]; }); 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) { some: function(array, predicate) {
var length = array.length, i; var length = array.length, i;

Loading…
Cancel
Save