WebKit Bugzilla
Attachment 370553 Details for
Bug 198207
: Web Inspector: prevent stripping `console.assert` if it's used inside a string
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198207-20190523193932.patch (text/plain), 1.87 KB, created by
Devin Rousso
on 2019-05-23 19:39:33 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Devin Rousso
Created:
2019-05-23 19:39:33 PDT
Size:
1.87 KB
patch
obsolete
>diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index e3aa85b0222c695a87a1c48fc8c5653d815906a6..c0c3b8a4e0c8d6273b62d2f028628c0ac7cbe1dc 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,13 @@ >+2019-05-23 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: prevent stripping `console.assert` if it's used inside a string >+ https://bugs.webkit.org/show_bug.cgi?id=198207 >+ >+ Reviewed by Joseph Pecoraro. >+ >+ * Scripts/remove-console-asserts.pl: >+ (removeConsoleAssertsInFile): >+ > 2019-05-23 Devin Rousso <drousso@apple.com> > > Web Inspector: Overlay: rulers/guides should be shown whenever element selection is enabled >diff --git a/Source/WebInspectorUI/Scripts/remove-console-asserts.pl b/Source/WebInspectorUI/Scripts/remove-console-asserts.pl >index cb20608d6859ab2d044ef4c07337e6e46df83cff..488d84dc8ef6a2df4fdb3b181e7c084513332428 100755 >--- a/Source/WebInspectorUI/Scripts/remove-console-asserts.pl >+++ b/Source/WebInspectorUI/Scripts/remove-console-asserts.pl >@@ -49,12 +49,18 @@ sub removeConsoleAssertsInFile($$) > } > } > >- s/\s*console\.assert\(.*\);\s*//g; >+ s/^\s*console\.assert\(.*\);\s*//g; > print $out $_; > $previousLine = $_ if $_ !~ /^\s*$/; > > # If console.assert is still on the line, either we missed a semicolon or it is multi-line. These did not get stripped. > if ($_ =~ /\s*console\.assert\(/) { >+ # Allow "console.assert()" to be used as part of a string. >+ next if /^.*?["'`].*?console\.assert/; >+ >+ # Allow "console.assert()" to be used as part of a comment. >+ next if /^.*?(\/\/|\/\*).*?console\.assert/; >+ > if ($_ =~ /\)\s*$/) { > print "WARNING: console.assert missing trailing semicolon on line $.: $_" ; > } else {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198207
:
370546
|
370547
|
370548
| 370553