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

Unified Diff: Source/devtools/scripts/compile_frontend.py

Issue 472903003: DevTools: Get rid of module initializers in the source tree (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add missing worker module.json's to gypi Created 6 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
Index: Source/devtools/scripts/compile_frontend.py
diff --git a/Source/devtools/scripts/compile_frontend.py b/Source/devtools/scripts/compile_frontend.py
index 4172a686da95bd4d2a88fa3c55c082abea463753..c240c1be766fdf7752e275795eedc81ed7ba811a 100755
--- a/Source/devtools/scripts/compile_frontend.py
+++ b/Source/devtools/scripts/compile_frontend.py
@@ -87,7 +87,6 @@ invalid_type_regex = re.compile(r"@(?:" + type_checked_jsdoc_tags_or + r")\s*\{.
invalid_type_designator_regex = re.compile(r"@(?:" + type_checked_jsdoc_tags_or + r")\s*.*(?<![{: ])([?!])=?\}")
-importscript_regex = re.compile(r"importScript\(\s*[\"']")
error_warning_regex = re.compile(r"(?:WARNING|ERROR)")
errors_found = False
@@ -101,26 +100,6 @@ def hasErrors(output):
return re.search(error_warning_regex, output) != None
-def verify_importScript_usage():
- errors_found = False
- for module in modules:
- for file_name in module["sources"]:
- if path.basename(file_name) == module_initializer_name:
- log_error("Module initializer (%s) may not be listed among module's scripts; found in '%s'" % (module_initializer_name, module["name"]))
- errors_found = True
- continue
- try:
- with open(path.join(devtools_frontend_path, file_name), "r") as sourceFile:
- source = sourceFile.read()
- if re.search(importscript_regex, source):
- log_error("importScript() call only allowed in module initializers (%s); found in %s" % (module_initializer_name, file_name))
- errors_found = True
- except:
- log_error("Failed to access %s" % file_name)
- raise
- return errors_found
-
-
def dump_all_checked_files():
files = {}
for module in modules:
@@ -185,9 +164,6 @@ def check_java_path():
check_java_path()
-print "Verifying 'importScript' function usage..."
-errors_found |= verify_importScript_usage()
-
modules_dir = tempfile.mkdtemp()
common_closure_args = " --summary_detail_level 3 --jscomp_error visibility --compilation_level SIMPLE_OPTIMIZATIONS --warning_level VERBOSE --language_in ECMASCRIPT5 --accept_const_keyword --module_output_path_prefix %s/" % modules_dir

Powered by Google App Engine
This is Rietveld 408576698