Bug 148728 - Web Inspector: jsmin.py mistakenly removes whitespace from template literal strings
Summary: Web Inspector: jsmin.py mistakenly removes whitespace from template literal s...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: BJ Burg
URL:
Keywords: InRadar
Depends on: 148730
Blocks: 148726
  Show dependency treegraph
 
Reported: 2015-09-02 16:24 PDT by BJ Burg
Modified: 2015-10-28 14:18 PDT (History)
8 users (show)

See Also:


Attachments
testcase (232 bytes, text/html)
2015-09-02 16:24 PDT, BJ Burg
no flags Details
Proposed Fix (2.76 KB, patch)
2015-09-02 17:51 PDT, BJ Burg
no flags Details | Formatted Diff | Diff
Patch (2.62 KB, patch)
2015-10-28 13:28 PDT, Timothy Hatcher
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description BJ Burg 2015-09-02 16:24:15 PDT
Created attachment 260451 [details]
testcase

Running the following on the test case:

$ python ./Source/WebInspectorUI/Scripts/jsmin.py < ~/Desktop/testcases/console-log-template-literal-string.html 

Produces the following output:

<!doctype html><html><body onload="runTest()"><script>function runTest()
{let foo=42;console.log(`My favorite number is:${foo}`);}</script><p>To reproduce the bug,try to minify this page.</p></body></html>
Comment 1 Radar WebKit Bug Importer 2015-09-02 16:25:25 PDT
<rdar://problem/22548921>
Comment 2 BJ Burg 2015-09-02 16:44:30 PDT
I tested upstream jsmin.py 2.1.4, and by adding '`' to quote_chars, there are no longer any test regressions caused by stripping whitespace from template literal strings.
Comment 3 BJ Burg 2015-09-02 17:51:08 PDT
Created attachment 260460 [details]
Proposed Fix

Does not apply, depends on jsmin update.
Comment 4 Joseph Pecoraro 2015-09-02 18:04:53 PDT
Comment on attachment 260460 [details]
Proposed Fix

r=me
Comment 5 BJ Burg 2015-10-28 13:13:44 PDT
Marked WONTFIX because upstream jsmin regresses and is unable to minify other inspector code. Looking for other alternative.
Comment 6 Timothy Hatcher 2015-10-28 13:25:30 PDT
Found a fix for our current jsmin.py.
Comment 7 Timothy Hatcher 2015-10-28 13:28:22 PDT
Created attachment 264238 [details]
Patch
Comment 8 Joseph Pecoraro 2015-10-28 13:31:40 PDT
Comment on attachment 264238 [details]
Patch

r=me!
Comment 9 WebKit Commit Bot 2015-10-28 14:18:34 PDT
Comment on attachment 264238 [details]
Patch

Clearing flags on attachment: 264238

Committed r191692: <http://trac.webkit.org/changeset/191692>
Comment 10 WebKit Commit Bot 2015-10-28 14:18:38 PDT
All reviewed patches have been landed.  Closing bug.