From b77d33ca05794927b17356c58868a04c99a3749b Mon Sep 17 00:00:00 2001 From: David Majda Date: Fri, 5 Aug 2016 14:46:32 +0200 Subject: [PATCH] generate-js.js: Quote the "class" key in DESCRIBE_EXPECTATION_FNS "class" is a reserved word. Having it as a key unquoted broke IE 8 (both in standards and quirks mode) and IE 9 (in quirks mode). --- lib/compiler/passes/generate-js.js | 2 +- lib/parser.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/compiler/passes/generate-js.js b/lib/compiler/passes/generate-js.js index e70d99e..aafc4e5 100644 --- a/lib/compiler/passes/generate-js.js +++ b/lib/compiler/passes/generate-js.js @@ -788,7 +788,7 @@ function generateJS(ast, options) { ' return "\\\"" + literalEscape(expectation.text) + "\\\"";', ' },', '', - ' class: function(expectation) {', + ' "class": function(expectation) {', ' var escapedParts = "",', ' i;', '', diff --git a/lib/parser.js b/lib/parser.js index 666f2f5..17c6230 100644 --- a/lib/parser.js +++ b/lib/parser.js @@ -35,7 +35,7 @@ peg$SyntaxError.buildMessage = function(expected, found) { return "\"" + literalEscape(expectation.text) + "\""; }, - class: function(expectation) { + "class": function(expectation) { var escapedParts = "", i;