Bug 130166 - Web Inspector: Fix multiple console.assert stripping issues
Summary: Web Inspector: Fix multiple console.assert stripping issues
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-03-12 16:42 PDT by Joseph Pecoraro
Modified: 2014-03-12 17:35 PDT (History)
5 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (5.71 KB, patch)
2014-03-12 17:03 PDT, Joseph Pecoraro
timothy: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2014-03-12 16:42:55 PDT
- one console.assert missing semicolon, assumed to be multi-line, not stripped
- one console.assert inside of a for loop without braces, results in following line accidentally looping!

I plan on adding a WARNING to catch the second error.
Comment 1 Joseph Pecoraro 2014-03-12 16:50:52 PDT
With the new warning, and a script to process each JS file of ours, this is the output I see:

    shell> ./Scripts/remove-console-asserts-dryrun.rb 
    DOMTreeManager.js:
    WARNING: console.assert inside control flow statement without braces on line: 556:             console.assert(contentFlow.contentNodes[i].id === flowPayload.content[i]);

    DataGrid.js:
    WARNING: Multi-line console.assert on line 775:         console.assert(!child.isPlaceholderNode, "Shouldn't delete the placeholder node.")
Comment 2 Joseph Pecoraro 2014-03-12 17:00:32 PDT
If the line ends in a ')' then its likely not multi-line and just a missing semicolon. Changed that warning to:

    DataGrid.js:
    WARNING: console.assert missing trailing semicolon on line 775:         console.assert(!child.isPlaceholderNode, "Shouldn't delete the placeholder node.")
Comment 3 Joseph Pecoraro 2014-03-12 17:03:11 PDT
Created attachment 226560 [details]
[PATCH] Proposed Fix
Comment 4 Joseph Pecoraro 2014-03-12 17:35:46 PDT
<http://trac.webkit.org/changeset/165516>