Bug 198207

Summary: Web Inspector: prevent stripping `console.assert` if it's used inside a string
Product: WebKit Reporter: Devin Rousso <hi>
Component: Web InspectorAssignee: Devin Rousso <hi>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, hi, inspector-bugzilla-changes, joepeck, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 195132    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch none

Description Devin Rousso 2019-05-23 19:15:32 PDT
```
    console.assert(false, "foo");
```
should be stripped


```
    let x = "console.assert(false);"
```
should not be stripped
Comment 1 Devin Rousso 2019-05-23 19:24:33 PDT
Created attachment 370546 [details]
Patch
Comment 2 Devin Rousso 2019-05-23 19:26:16 PDT
Created attachment 370547 [details]
Patch
Comment 3 Joseph Pecoraro 2019-05-23 19:28:52 PDT
Comment on attachment 370547 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=370547&action=review

> Source/WebInspectorUI/Scripts/remove-console-asserts.pl:52
> +        s/^\s*console\.assert\(.*\);\s*//g;

This is nice. I approve this.

> Source/WebInspectorUI/Scripts/remove-console-asserts.pl:59
> +            next if /^["'`]*console\.assert/;

This doesn't do what you think it does.
Comment 4 Devin Rousso 2019-05-23 19:30:49 PDT
Created attachment 370548 [details]
Patch
Comment 5 Joseph Pecoraro 2019-05-23 19:33:57 PDT
Comment on attachment 370548 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=370548&action=review

sh

> Source/WebInspectorUI/Scripts/remove-console-asserts.pl:59
> +            next if /^.*?["'`].*?console\.assert/;

/["'`].*?console\.assert/
Comment 6 Joseph Pecoraro 2019-05-23 19:35:11 PDT
Comment on attachment 370548 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=370548&action=review

>> Source/WebInspectorUI/Scripts/remove-console-asserts.pl:59
>> +            next if /^.*?["'`].*?console\.assert/;
> 
> /["'`].*?console\.assert/

/\/\/.*?console\.assert/
Comment 7 Devin Rousso 2019-05-23 19:39:33 PDT
Created attachment 370553 [details]
Patch
Comment 8 WebKit Commit Bot 2019-05-23 20:19:58 PDT
Comment on attachment 370553 [details]
Patch

Clearing flags on attachment: 370553

Committed r245741: <https://trac.webkit.org/changeset/245741>
Comment 9 WebKit Commit Bot 2019-05-23 20:20:00 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 Radar WebKit Bug Importer 2019-05-23 20:20:25 PDT
<rdar://problem/51093853>