diff --git a/spec/generated-parser.spec.js b/spec/generated-parser.spec.js index a904549..3a45c75 100644 --- a/spec/generated-parser.spec.js +++ b/spec/generated-parser.spec.js @@ -91,7 +91,7 @@ describe("generated parser", function() { }; } - var result, key; + var result; try { result = this.actual.parse(input, options); @@ -106,6 +106,12 @@ describe("generated parser", function() { return false; } catch (e) { + /* + * Should be at the top level but then JSHint complains about bad for + * in variable. + */ + var key; + if (this.isNot) { this.message = function() { return "Expected " + jasmine.pp(input) diff --git a/spec/parser.spec.js b/spec/parser.spec.js index f07a69d..b6b908a 100644 --- a/spec/parser.spec.js +++ b/spec/parser.spec.js @@ -118,7 +118,7 @@ describe("PEG.js grammar parser", function() { }; } - var result, key; + var result; try { result = PEG.parser.parse(this.actual); @@ -131,6 +131,12 @@ describe("PEG.js grammar parser", function() { return false; } catch (e) { + /* + * Should be at the top level but then JSHint complains about bad for + * in variable. + */ + var key; + if (this.isNot) { this.message = function() { return "Expected " + jasmine.pp(this.actual) + " to parse, "