Web Inspector: Broken Inspector when resources are minified
https://bugs.webkit.org/show_bug.cgi?id=151711

Reviewed by Timothy Hatcher.

* Scripts/combine-resources.pl:
(concatenateFiles):
Provide a way to just strip resources matches a pattern.

* Scripts/copy-user-interface-resources.pl:
Strip "Debug/" resources before combining / minifying others.

* UserInterface/Views/View.js:
(WebInspector.View.prototype.makeRootView):
(WebInspector.View.prototype.didDetach):
Address warnings from the console.assert stripping phase
for console.assert statements lacking a trailing semicolon.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@192902 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebInspectorUI/Scripts/copy-user-interface-resources.pl b/Source/WebInspectorUI/Scripts/copy-user-interface-resources.pl
index 72c16e7..6324861 100755
--- a/Source/WebInspectorUI/Scripts/copy-user-interface-resources.pl
+++ b/Source/WebInspectorUI/Scripts/copy-user-interface-resources.pl
@@ -148,11 +148,14 @@
 my $combineResourcesCmd = File::Spec->catfile($scriptsRoot, 'combine-resources.pl');
 
 if ($shouldCombineMain) {
+    # Remove Debug JavaScript and CSS files in Production builds.
+    system($combineResourcesCmd, '--input-dir', 'Debug', '--input-html', File::Spec->catfile($uiRoot, 'Main.html'), '--input-html-dir', $uiRoot, '--derived-sources-dir', $derivedSourcesDir, '--output-dir', $derivedSourcesDir, '--output-script-name', 'Debug.js', '--output-style-name', 'Debug.css', '--strip');
+
     # Combine the JavaScript and CSS files in Production builds into single files (Main.js and Main.css).
-    system($combineResourcesCmd, '--input-html', File::Spec->catfile($uiRoot, 'Main.html'), '--derived-sources-dir', $derivedSourcesDir, '--output-dir', $derivedSourcesDir, '--output-script-name', 'Main.js', '--output-style-name', 'Main.css');
+    my $derivedSourcesMainHTML = File::Spec->catfile($derivedSourcesDir, 'Main.html');
+    system($combineResourcesCmd, '--input-html', $derivedSourcesMainHTML, '--input-html-dir', $uiRoot, '--derived-sources-dir', $derivedSourcesDir, '--output-dir', $derivedSourcesDir, '--output-script-name', 'Main.js', '--output-style-name', 'Main.css');
 
     # Combine the CodeMirror JavaScript and CSS files in Production builds into single files (CodeMirror.js and CodeMirror.css).
-    my $derivedSourcesMainHTML = File::Spec->catfile($derivedSourcesDir, 'Main.html');
     system($combineResourcesCmd, '--input-dir', 'External/CodeMirror', '--input-html', $derivedSourcesMainHTML, '--input-html-dir', $uiRoot, '--derived-sources-dir', $derivedSourcesDir, '--output-dir', $derivedSourcesDir, '--output-script-name', 'CodeMirror.js', '--output-style-name', 'CodeMirror.css');
 
     # Combine the Esprima JavaScript files in Production builds into a single file (Esprima.js).