Changeset 235452 in webkit
- Timestamp:
- Aug 28, 2018 6:36:36 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r235449 r235452 1 2018-08-28 Devin Rousso <drousso@apple.com> 2 3 console.log() shows (anonymous function) instead of the passed string when a certain format is used 4 https://bugs.webkit.org/show_bug.cgi?id=188946 5 <rdar://problem/43756428> 6 7 Reviewed by Brian Burg. 8 9 * inspector/console/js-isLikelyStackTrace-expected.txt: 10 * inspector/console/js-isLikelyStackTrace.html: 11 1 12 2018-08-28 Truitt Savell <tsavell@apple.com> 2 13 -
trunk/LayoutTests/inspector/console/js-isLikelyStackTrace-expected.txt
r231717 r235452 19 19 Actual: false 20 20 21 -- Running test case: testFormattedStrings 22 PASS: "video:1:2" should not be a stacktrace. 23 PASS: "video/mp4:1:2" should not be a stacktrace. 24 PASS: "video/mp4 : 11:22:33-44:55:66" should not be a stacktrace. 25 PASS: "http://video:1:2" should not be a stacktrace. 26 PASS: "http://video/mp4:1:2" should not be a stacktrace. 27 PASS: "http://video/mp4 : 11:22:33-44:55:66" should not be a stacktrace. 28 -
trunk/LayoutTests/inspector/console/js-isLikelyStackTrace.html
r225950 r235452 96 96 }); 97 97 98 suite.addTestCase({ 99 name: "testFormattedStrings", 100 test(resolve, reject) { 101 const strings = [ 102 "video:1:2", 103 "video/mp4:1:2", 104 "video/mp4 : 11:22:33-44:55:66", 105 "http://video:1:2", 106 "http://video/mp4:1:2", 107 "http://video/mp4 : 11:22:33-44:55:66", 108 ]; 109 110 for (let string of strings) 111 InspectorTest.expectThat(!WI.StackTrace.isLikelyStackTrace(string), `"${string}" should not be a stacktrace.`); 112 113 resolve(); 114 } 115 }); 116 98 117 suite.runTestCasesAndFinish(); 99 118 } -
trunk/Source/WebInspectorUI/ChangeLog
r235451 r235452 1 2018-08-28 Devin Rousso <drousso@apple.com> 2 3 console.log() shows (anonymous function) instead of the passed string when a certain format is used 4 https://bugs.webkit.org/show_bug.cgi?id=188946 5 <rdar://problem/43756428> 6 7 Reviewed by Brian Burg. 8 9 Stack trace URLs are much more likely to follow the following format: 10 11 <protocol>://<path>:<line>:<column> 12 13 Modify the test regexp to always require that a protocol exists and to check that there are 14 no ":" inside the protocol or path. Additionally, stack traces usually have more than one 15 frame, so return false if there isn't more than one line. 16 17 * UserInterface/Models/StackTrace.js: 18 (WI.StackTrace.isLikelyStackTrace): 19 1 20 2018-08-28 Devin Rousso <drousso@apple.com> 2 21 -
trunk/Source/WebInspectorUI/UserInterface/Models/StackTrace.js
r220119 r235452 81 81 return false; 82 82 83 const reasonablyLongProtocolLength = 10; 83 84 const reasonablyLongLineLength = 500; 84 85 const reasonablyLongNativeMethodLength = 120; 85 const stackTraceLine = `(.{1,${reasonablyLongLineLength}}:\\d+:\\d+|eval code|.{1,${reasonablyLongNativeMethodLength}}@\\[native code\\])`; 86 const stackTrace = new RegExp(`^${stackTraceLine}(\\n${stackTraceLine})*$`, "g"); 87 86 const stackTraceLine = `(global code|eval code|module code|\\w+)?([^:]{1,${reasonablyLongProtocolLength}}://[^:]{1,${reasonablyLongLineLength}}:\\d+:\\d+|[^@]{1,${reasonablyLongNativeMethodLength}}@\\[native code\\])`; 87 const stackTrace = new RegExp(`^${stackTraceLine}([\\n\\r]${stackTraceLine})+$`, "g"); 88 88 return stackTrace.test(stack); 89 89 }
Note: See TracChangeset
for help on using the changeset viewer.