From d61fd1792daceb32192fa937566509c19919d701 Mon Sep 17 00:00:00 2001 From: David Majda Date: Sat, 5 Jan 2013 20:28:24 +0100 Subject: [PATCH] Fix JSHint errors Fixes the following JSHint errors (which I think are JSHint bugs): spec/parser.spec.js: line 142, col 20, Bad for in variable 'key'. spec/generated-parser.spec.js: line 119, col 20, Bad for in variable 'key'. --- spec/generated-parser.spec.js | 8 +++++++- spec/parser.spec.js | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) 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, "