WebKit Bugzilla
Attachment 348356 Details for
Bug 188946
: console.log() shows (anonymous function) instead of the passed string when a certain format is used
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188946-20180828154827.patch (text/plain), 5.04 KB, created by
Devin Rousso
on 2018-08-28 15:48:28 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Devin Rousso
Created:
2018-08-28 15:48:28 PDT
Size:
5.04 KB
patch
obsolete
>diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index aca81e50605fd17f184bba6c95518eab29c53ad0..f92cabbe65300802062634d615a3a712f1330515 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,22 @@ >+2018-08-28 Devin Rousso <drousso@apple.com> >+ >+ console.log() shows (anonymous function) instead of the passed string when a certain format is used >+ https://bugs.webkit.org/show_bug.cgi?id=188946 >+ <rdar://problem/43756428> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Stack trace URLs are much more likely to follow the following format: >+ >+ <protocol>://<path>:<line>:<column> >+ >+ Modify the test regexp to always require that a protocol exists and to check that there are >+ no ":" inside the protocol or path. Additionally, stack traces usually have more than one >+ frame, so return false if there isn't more than one line. >+ >+ * UserInterface/Models/StackTrace.js: >+ (WI.StackTrace.isLikelyStackTrace): >+ > 2018-08-27 Keith Rollin <krollin@apple.com> > > Unreviewed build fix -- disable LTO for production builds >diff --git a/Source/WebInspectorUI/UserInterface/Models/StackTrace.js b/Source/WebInspectorUI/UserInterface/Models/StackTrace.js >index ca72995416cc7b4625c924f6f86dd7a9ea4b9e77..1dfea88506b95ceae60583f44641df9f5616ec5a 100644 >--- a/Source/WebInspectorUI/UserInterface/Models/StackTrace.js >+++ b/Source/WebInspectorUI/UserInterface/Models/StackTrace.js >@@ -80,11 +80,11 @@ WI.StackTrace = class StackTrace > if (/^[^a-z$_]/i.test(stack[0])) > return false; > >+ const reasonablyLongProtocolLength = 10; > const reasonablyLongLineLength = 500; > const reasonablyLongNativeMethodLength = 120; >- const stackTraceLine = `(.{1,${reasonablyLongLineLength}}:\\d+:\\d+|eval code|.{1,${reasonablyLongNativeMethodLength}}@\\[native code\\])`; >- const stackTrace = new RegExp(`^${stackTraceLine}(\\n${stackTraceLine})*$`, "g"); >- >+ const stackTraceLine = `(global code|eval code|module code|\\w+)?([^:]{1,${reasonablyLongProtocolLength}}://[^:]{1,${reasonablyLongLineLength}}:\\d+:\\d+|[^@]{1,${reasonablyLongNativeMethodLength}}@\\[native code\\])`; >+ const stackTrace = new RegExp(`^${stackTraceLine}([\\n\\r]${stackTraceLine})+$`, "g"); > return stackTrace.test(stack); > } > >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index e4f151a931261dbcebaac3318fc9a89626c05033..76570cd2a2e39814afddd02b30aa5f182d7d3ed4 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,14 @@ >+2018-08-28 Devin Rousso <drousso@apple.com> >+ >+ console.log() shows (anonymous function) instead of the passed string when a certain format is used >+ https://bugs.webkit.org/show_bug.cgi?id=188946 >+ <rdar://problem/43756428> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * inspector/console/js-isLikelyStackTrace-expected.txt: >+ * inspector/console/js-isLikelyStackTrace.html: >+ > 2018-08-27 Mark Lam <mark.lam@apple.com> > > Fix exception throwing code so that topCallFrame and topEntryFrame stay true to their names. >diff --git a/LayoutTests/inspector/console/js-isLikelyStackTrace-expected.txt b/LayoutTests/inspector/console/js-isLikelyStackTrace-expected.txt >index f2a408688a6e74496f9fec149101b0b5113ef24d..9687076e026292e10115ad73fd4995658a5680a2 100644 >--- a/LayoutTests/inspector/console/js-isLikelyStackTrace-expected.txt >+++ b/LayoutTests/inspector/console/js-isLikelyStackTrace-expected.txt >@@ -18,3 +18,11 @@ FAIL: Should be a stacktrace. > Expected: truthy > Actual: false > >+-- Running test case: testFormattedStrings >+PASS: "video:1:2" should not be a stacktrace. >+PASS: "video/mp4:1:2" should not be a stacktrace. >+PASS: "video/mp4 : 11:22:33-44:55:66" should not be a stacktrace. >+PASS: "http://video:1:2" should not be a stacktrace. >+PASS: "http://video/mp4:1:2" should not be a stacktrace. >+PASS: "http://video/mp4 : 11:22:33-44:55:66" should not be a stacktrace. >+ >diff --git a/LayoutTests/inspector/console/js-isLikelyStackTrace.html b/LayoutTests/inspector/console/js-isLikelyStackTrace.html >index a2db42b6084e16f109455aee902cb7d9ed815d30..c81e9a65a344b15a86271a9954594f138a9b4f46 100644 >--- a/LayoutTests/inspector/console/js-isLikelyStackTrace.html >+++ b/LayoutTests/inspector/console/js-isLikelyStackTrace.html >@@ -95,6 +95,25 @@ function test() > } > }); > >+ suite.addTestCase({ >+ name: "testFormattedStrings", >+ test(resolve, reject) { >+ const strings = [ >+ "video:1:2", >+ "video/mp4:1:2", >+ "video/mp4 : 11:22:33-44:55:66", >+ "http://video:1:2", >+ "http://video/mp4:1:2", >+ "http://video/mp4 : 11:22:33-44:55:66", >+ ]; >+ >+ for (let string of strings) >+ InspectorTest.expectThat(!WI.StackTrace.isLikelyStackTrace(string), `"${string}" should not be a stacktrace.`); >+ >+ resolve(); >+ } >+ }); >+ > suite.runTestCasesAndFinish(); > } > </script>
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 188946
:
348079
|
348271
|
348272
|
348278
|
348282
|
348283
|
348303
|
348316
| 348356