From 9808b88ccbf2d9267d41abcbd2f916d97e8e7922 Mon Sep 17 00:00:00 2001 From: David Majda Date: Fri, 23 Sep 2016 05:56:52 +0200 Subject: [PATCH] generated-parser-behavior.spec.js: Move variable inside loop --- spec/behavior/generated-parser-behavior.spec.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/spec/behavior/generated-parser-behavior.spec.js b/spec/behavior/generated-parser-behavior.spec.js index bc819e1..a28da22 100644 --- a/spec/behavior/generated-parser-behavior.spec.js +++ b/spec/behavior/generated-parser-behavior.spec.js @@ -503,10 +503,9 @@ describe("generated parser behavior", function() { input: "b" } ]; - let parser; testcases.forEach(testcase => { - parser = peg.generate(testcase.grammar, options); + let parser = peg.generate(testcase.grammar, options); expect(parser).toFailToParse(testcase.input); }); }); @@ -697,10 +696,9 @@ describe("generated parser behavior", function() { input: "b" } ]; - let parser; testcases.forEach(testcase => { - parser = peg.generate(testcase.grammar, options); + let parser = peg.generate(testcase.grammar, options); expect(parser).toFailToParse(testcase.input); }); }); @@ -1066,10 +1064,9 @@ describe("generated parser behavior", function() { input: "b" } ]; - let parser; testcases.forEach(testcase => { - parser = peg.generate(testcase.grammar, options); + let parser = peg.generate(testcase.grammar, options); expect(parser).toFailToParse(testcase.input); }); });