Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(514)

Unified Diff: tools/jsmin.py

Issue 1127543003: Revert of Reland "Wrap v8natives.js into a function." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/compiler/jsnatives.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/jsmin.py
diff --git a/tools/jsmin.py b/tools/jsmin.py
index cadc98b25897b30441236f790169adf4debe7d4d..250dea9d72bf2f6e2780c3368d7891d1efdc3278 100644
--- a/tools/jsmin.py
+++ b/tools/jsmin.py
@@ -100,12 +100,6 @@
The string that should replace the match in the rewritten program.
"""
matched_text = m.group(0)
-
- if matched_text.startswith("`") and matched_text.endswith("`"):
- return re.sub(r"\$\{([\w$%]+)\}",
- lambda m: '${' + self.FindNewName(m.group(1)) + '}',
- matched_text)
-
if matched_text == "{":
self.Push()
return matched_text
@@ -158,9 +152,6 @@
return self.map[var_name]
if self.nesting == 0:
return var_name
- # Do not rename arguments object.
- if var_name == 'arguments':
- return 'arguments'
while True:
identifier_first_char = self.identifier_counter % 52
identifier_second_char = self.identifier_counter // 52
@@ -192,8 +183,6 @@
if re.match(r"'.*'$", entire_match):
return entire_match
if re.match(r'".*"$', entire_match):
- return entire_match
- if re.match(r"`.*`$", entire_match):
return entire_match
if re.match(r"/.+/$", entire_match):
return entire_match
@@ -238,10 +227,8 @@
# This regexp can handle embedded backslash-escaped characters including
# embedded backslash-escaped double quotes.
double_quoted_string = r'"(?:[^"\\]|\\.)*"'
- # A regexp that matches a literal string surrounded by 'single quotes'.
+ # A regexp that matches a literal string surrounded by 'double quotes'.
single_quoted_string = r"'(?:[^'\\]|\\.)*'"
- # A regexp that matches a template string
- template_string = r"`(?:[^'\\]|\\.)*`"
# 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
# syntax error and it's probably just two unrelated slashes.
@@ -251,7 +238,6 @@
# Replace multiple spaces with a single space.
line = re.sub("|".join([double_quoted_string,
single_quoted_string,
- template_string,
slash_quoted_regexp,
"( )+"]),
self.RemoveSpaces,
@@ -260,7 +246,6 @@
# and after the space. % and $ are counted as identifier characters.
line = re.sub("|".join([double_quoted_string,
single_quoted_string,
- template_string,
slash_quoted_regexp,
r"(?<![a-zA-Z_0-9$%]) | (?![a-zA-Z_0-9$%])()"]),
self.RemoveSpaces,
@@ -284,7 +269,6 @@
variable_use_regexp = r"(?<![.\w$%])[\w$%]+" + block_trailing_colon
line = re.sub("|".join([double_quoted_string,
single_quoted_string,
- template_string,
slash_quoted_regexp,
r"\{", # Curly braces.
r"\}",
« no previous file with comments | « test/mjsunit/compiler/jsnatives.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698