From 1f7efd57c08117b849ca821f6523504dc591cc31 Mon Sep 17 00:00:00 2001 From: David Majda Date: Fri, 10 Jun 2016 16:20:58 +0200 Subject: [PATCH] Remove various JSHint-related cruft We use ESLint now, which is smarter about some things. --- lib/compiler/js.js | 5 +++-- spec/behavior/generated-parser-behavior.spec.js | 8 +------- spec/unit/compiler/passes/helpers.js | 9 ++------- spec/unit/parser.spec.js | 8 +------- 4 files changed, 7 insertions(+), 23 deletions(-) diff --git a/lib/compiler/js.js b/lib/compiler/js.js index 89821b3..c9222f4 100644 --- a/lib/compiler/js.js +++ b/lib/compiler/js.js @@ -12,12 +12,13 @@ var js = { * may appear in the form of an escape sequence. * * For portability, we also escape all control and non-ASCII characters. - * Note that "\0" and "\v" escape sequences are not used because JSHint does - * not like the first and IE the second. + * Note that the "\v" escape sequence is not used because IE does not like + * it. */ return s .replace(/\\/g, '\\\\') // backslash .replace(/"/g, '\\"') // closing double quote + .replace(/\0/g, '\\0') // null .replace(/\x08/g, '\\b') // backspace .replace(/\t/g, '\\t') // horizontal tab .replace(/\n/g, '\\n') // line feed diff --git a/spec/behavior/generated-parser-behavior.spec.js b/spec/behavior/generated-parser-behavior.spec.js index f129494..8e04eda 100644 --- a/spec/behavior/generated-parser-behavior.spec.js +++ b/spec/behavior/generated-parser-behavior.spec.js @@ -71,7 +71,7 @@ describe("generated parser behavior", function() { toFailToParse: function(input, details, options) { options = options !== undefined ? options : {}; - var result; + var result, key; try { result = this.actual.parse(input, options); @@ -86,12 +86,6 @@ describe("generated parser behavior", 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/unit/compiler/passes/helpers.js b/spec/unit/compiler/passes/helpers.js index 42fb606..16c9e89 100644 --- a/spec/unit/compiler/passes/helpers.js +++ b/spec/unit/compiler/passes/helpers.js @@ -61,7 +61,8 @@ beforeEach(function() { }, toReportError: function(grammar, details) { - var ast = peg.parser.parse(grammar); + var ast = peg.parser.parse(grammar), + key; try { this.actual(ast); @@ -75,12 +76,6 @@ beforeEach(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 the pass not to report an error " diff --git a/spec/unit/parser.spec.js b/spec/unit/parser.spec.js index 88b20da..2871cf2 100644 --- a/spec/unit/parser.spec.js +++ b/spec/unit/parser.spec.js @@ -204,7 +204,7 @@ describe("PEG.js grammar parser", function() { }, toFailToParse: function(details) { - var result; + var result, key; try { result = peg.parser.parse(this.actual); @@ -219,12 +219,6 @@ 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, "