diff --git a/src/org/mozilla/javascript/Parser.java b/src/org/mozilla/javascript/Parser.java index 9a89faf7dc..7dffa2e346 100644 --- a/src/org/mozilla/javascript/Parser.java +++ b/src/org/mozilla/javascript/Parser.java @@ -3087,6 +3087,7 @@ private AstNode primaryExpr() throws IOException { return new KeywordLiteral(pos, end - pos, tt); case Token.QUASI: + consumeToken(); return quasiLiteral(); case Token.RESERVED: diff --git a/src/org/mozilla/javascript/ScriptRuntime.java b/src/org/mozilla/javascript/ScriptRuntime.java index 2ecef8152f..d7c0a4f112 100644 --- a/src/org/mozilla/javascript/ScriptRuntime.java +++ b/src/org/mozilla/javascript/ScriptRuntime.java @@ -878,7 +878,7 @@ public static String escapeString(String s) { * For escaping strings printed by object and array literals; not quite the same as 'escape.' */ public static String escapeString(String s, char escapeQuote) { - if (!(escapeQuote == '"' || escapeQuote == '\'' || escapeQuote == '`')) Kit.codeBug(); + if (!(escapeQuote == '"' || escapeQuote == '\'')) Kit.codeBug(); StringBuilder sb = null; for (int i = 0, L = s.length(); i != L; ++i) { diff --git a/src/org/mozilla/javascript/TokenStream.java b/src/org/mozilla/javascript/TokenStream.java index 40a6179afc..cff7cbfc33 100644 --- a/src/org/mozilla/javascript/TokenStream.java +++ b/src/org/mozilla/javascript/TokenStream.java @@ -913,7 +913,7 @@ final int getToken() throws IOException { } // is it a string? - if (c == '"' || c == '\'' || c == '`') { + if (c == '"' || c == '\'') { // We attempt to accumulate a string the fast way, by // building it directly out of the reader. But if there // are any escaped characters in the string, we revert to @@ -2030,7 +2030,7 @@ private int getCharIgnoreLineEnd(boolean skipFormattingChars) throws IOException } } else { if (c == BYTE_ORDER_MARK) return c; // BOM is considered whitespace - if (isJSFormatChar(c)) { + if (skipFormattingChars && isJSFormatChar(c)) { continue; } if (ScriptRuntime.isJSLineTerminator(c)) {