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

Unified Diff: third_party/closure_linter/closure_linter/testutil.py

Issue 2328693002: Updated linter with upstream release (2.3.19) (Closed)
Patch Set: Created 4 years, 3 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
Index: third_party/closure_linter/closure_linter/testutil.py
diff --git a/third_party/closure_linter/closure_linter/testutil.py b/third_party/closure_linter/closure_linter/testutil.py
index b106ff025863ff395d12a12374e746f2004aed5f..f7084ee37b0683bda4a3495022074260d110fd35 100644
--- a/third_party/closure_linter/closure_linter/testutil.py
+++ b/third_party/closure_linter/closure_linter/testutil.py
@@ -60,11 +60,12 @@ def TokenizeSourceAndRunEcmaPass(source):
return start_token
-def ParseFunctionsAndComments(source):
+def ParseFunctionsAndComments(source, error_handler=None):
"""Run the tokenizer and tracker and return comments and functions found.
Args:
source: A source file as a string or file-like object (iterates lines).
+ error_handler: An error handler.
Returns:
The functions and comments as a tuple.
@@ -72,6 +73,8 @@ def ParseFunctionsAndComments(source):
start_token = TokenizeSourceAndRunEcmaPass(source)
tracker = javascriptstatetracker.JavaScriptStateTracker()
+ if error_handler is not None:
+ tracker.DocFlagPass(start_token, error_handler)
functions = []
comments = []

Powered by Google App Engine
This is Rietveld 408576698