From 71ef4c9b91d289e4efc29a25e222bf07d4689177 Mon Sep 17 00:00:00 2001 From: David Majda Date: Wed, 14 Sep 2016 10:01:47 +0200 Subject: [PATCH] Don't use "arrays" in lib/compiler/passes/remove-proxy-rules.js The "arrays" module will be removed. See #442. --- lib/compiler/passes/remove-proxy-rules.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/compiler/passes/remove-proxy-rules.js b/lib/compiler/passes/remove-proxy-rules.js index 5aa2eb2..dc8d2f4 100644 --- a/lib/compiler/passes/remove-proxy-rules.js +++ b/lib/compiler/passes/remove-proxy-rules.js @@ -1,7 +1,6 @@ "use strict"; -let arrays = require("../../utils/arrays"), - visitor = require("../visitor"); +let visitor = require("../visitor"); /* * Removes proxy rules -- that is, rules that only delegate to other rule. @@ -28,7 +27,7 @@ function removeProxyRules(ast, options) { ast.rules.forEach((rule, i) => { if (isProxyRule(rule)) { replaceRuleRefs(ast, rule.name, rule.expression.name); - if (!arrays.contains(options.allowedStartRules, rule.name)) { + if (options.allowedStartRules.indexOf(rule.name) === -1) { indices.push(i); } }