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

Unified Diff: third_party/closure_compiler/compile2.py

Issue 2179033002: Strip comments and whitespace from javascript resources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert changes to screen.js (no longer needed for this CL) Created 4 years, 4 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 | « third_party/closure_compiler/closure_args.gni ('k') | third_party/closure_compiler/js_minify.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/closure_compiler/compile2.py
diff --git a/third_party/closure_compiler/compile2.py b/third_party/closure_compiler/compile2.py
index 1efa41426111b54a87d0192f569ad7edc29b69e7..fdb57489dcd0aafa5629d416e3d4fee7cc7b9e17 100755
--- a/third_party/closure_compiler/compile2.py
+++ b/third_party/closure_compiler/compile2.py
@@ -225,7 +225,7 @@ class Checker(object):
self._log_debug("Dependencies: %s" % deps)
self._log_debug("Target: %s" % self._target)
- js_args = deps + [self._target] if self._target else []
+ js_args = deps + ([self._target] if self._target else [])
if not custom_sources:
# TODO(dbeam): compiler.jar automatically detects "@externs" in a --js arg
@@ -272,7 +272,8 @@ class Checker(object):
errors = stderr.strip().split("\n\n")
maybe_summary = errors.pop()
- if re.search(".*error.*warning.*typed", maybe_summary):
+ summary = re.search("(?P<error_count>\d+).*error.*warning", maybe_summary)
+ if summary:
self._log_debug("Summary: %s" % maybe_summary)
else:
# Not a summary. Running the jar failed. Bail.
@@ -280,7 +281,7 @@ class Checker(object):
self._nuke_temp_files()
sys.exit(1)
- if errors and out_file:
+ if summary.group('error_count') != "0" and out_file:
if os.path.exists(out_file):
os.remove(out_file)
if os.path.exists(self._MAP_FILE_FORMAT % out_file):
« no previous file with comments | « third_party/closure_compiler/closure_args.gni ('k') | third_party/closure_compiler/js_minify.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698