jsmin.py: Fix issue with escaping of back ticks

The escaping of back ticks in template strings was incorrect

BUG=v8:4240
LOG=N
TBR=yangguo@chromium.org

Review URL: https://codereview.chromium.org/1209713003

Cr-Commit-Position: refs/heads/master@{#29271}
This commit is contained in:
arv 2015-06-24 15:29:30 -07:00 committed by Commit bot
parent 6e6a1c8aee
commit a0f4706e5e

View File

@ -241,7 +241,7 @@ class JavaScriptMinifier(object):
# A regexp that matches a literal string surrounded by 'single quotes'. # A regexp that matches a literal string surrounded by 'single quotes'.
single_quoted_string = r"'(?:[^'\\]|\\.)*'" single_quoted_string = r"'(?:[^'\\]|\\.)*'"
# A regexp that matches a template string # A regexp that matches a template string
template_string = r"`(?:[^'\\]|\\.)*`" template_string = r"`(?:[^`\\]|\\.)*`"
# A regexp that matches a regexp literal surrounded by /slashes/. # A regexp that matches a regexp literal surrounded by /slashes/.
# Don't allow a regexp to have a ) before the first ( since that's a # Don't allow a regexp to have a ) before the first ( since that's a
# syntax error and it's probably just two unrelated slashes. # syntax error and it's probably just two unrelated slashes.