Web Inspector: test that "importScript" is used only in module heads.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Mar 2013 15:20:58 +0000 (15:20 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Mar 2013 15:20:58 +0000 (15:20 +0000)
https://bugs.webkit.org/show_bug.cgi?id=111548

Patch by Andrey Lushnikov <lushnikov@chromium.org> on 2013-03-06
Reviewed by Pavel Feldman.

Test that output file after all inlines does not have any 'importScript(s)' statements.

* scripts/inline_js_imports.py:
(main):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@144926 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/scripts/inline_js_imports.py

index d88e043..6e3c981 100644 (file)
@@ -1,3 +1,15 @@
+2013-03-06  Andrey Lushnikov  <lushnikov@chromium.org>
+
+        Web Inspector: test that "importScript" is used only in module heads.
+        https://bugs.webkit.org/show_bug.cgi?id=111548
+
+        Reviewed by Pavel Feldman.
+
+        Test that output file after all inlines does not have any 'importScript(s)' statements.
+
+        * scripts/inline_js_imports.py:
+        (main):
+
 2013-03-05  Alexandre Elias  <aelias@chromium.org>
 
         [chromium] Scroll deltas should be floats
index 776a3fc..4343226 100644 (file)
@@ -68,6 +68,10 @@ def main(argv):
         return import_script
 
     output_script = re.sub(r'importScripts?\([\'"]([^\'"]+)[\'"]\)', replace, input_script)
+    if re.search("importScripts?\(\"", output_script):
+        raise Exception('Unresolved "importScript" statements found in "%s". '
+                        'Make sure you call "importScript" in module heads only.' %
+                        (output_file_name))
 
     output_file = open(output_file_name, 'w')
     if not no_minify: