Changeset 194083 in webkit
- Timestamp:
- Dec 14, 2015 5:14:34 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r194082 r194083 1 2015-12-14 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Stack traces in console incorrectly show "(anonymous function)" for global code 4 https://bugs.webkit.org/show_bug.cgi?id=152280 5 6 Reviewed by Brian Burg. 7 8 * inspector/debugger/js-stacktrace-expected.txt: 9 * inspector/debugger/js-stacktrace.html: 10 1 11 2015-12-14 Ryan Haddad <ryanhaddad@apple.com> 2 12 -
trunk/LayoutTests/inspector/debugger/js-stacktrace-expected.txt
r190780 r194083 7 7 "columnNumber": 22, 8 8 "functionName": "typeError", 9 "nativeCode": false 9 "nativeCode": false, 10 "programCode": false 10 11 }, 11 12 { … … 13 14 "columnNumber": 21, 14 15 "functionName": "typeErrorWrap", 15 "nativeCode": false 16 "nativeCode": false, 17 "programCode": false 18 }, 19 { 20 "lineNumber": null, 21 "columnNumber": null, 22 "functionName": "eval code", 23 "nativeCode": true, 24 "programCode": true 16 25 } 17 26 ] … … 30 39 "lineNumber": 7, 31 40 "columnNumber": 21 41 }, 42 { 43 "functionName": "eval code", 44 "url": "", 45 "lineNumber": 0, 46 "columnNumber": 0 32 47 } 33 48 ] … … 39 54 "columnNumber": 22, 40 55 "functionName": "typeError", 41 "nativeCode": false 56 "nativeCode": false, 57 "programCode": false 42 58 }, 43 59 { … … 45 61 "columnNumber": null, 46 62 "functionName": "map", 47 "nativeCode": true 63 "nativeCode": true, 64 "programCode": false 48 65 }, 49 66 { … … 51 68 "columnNumber": 20, 52 69 "functionName": "testWithNativeCallInBetween", 53 "nativeCode": false 70 "nativeCode": false, 71 "programCode": false 72 }, 73 { 74 "lineNumber": null, 75 "columnNumber": null, 76 "functionName": "eval code", 77 "nativeCode": true, 78 "programCode": true 54 79 } 55 80 ] … … 74 99 "lineNumber": 23, 75 100 "columnNumber": 20 101 }, 102 { 103 "functionName": "eval code", 104 "url": "", 105 "lineNumber": 0, 106 "columnNumber": 0 76 107 } 77 108 ] -
trunk/LayoutTests/inspector/debugger/js-stacktrace.html
r190780 r194083 54 54 columnNumber: columnNumber, 55 55 functionName: callFrame.functionName, 56 nativeCode: callFrame.nativeCode 56 nativeCode: callFrame.nativeCode, 57 programCode: callFrame.programCode, 57 58 }); 58 59 } … … 113 114 var index = 0; 114 115 for (var frame of stackTrace) { 115 if (frame.nativeCode && frame.functionName === null) 116 index++; 117 if (frame.nativeCode && frame.functionName === "eval code") 116 118 break; 117 index++;118 119 } 119 120 return stackTrace.slice(0, index); … … 124 125 var index = 0; 125 126 for (var frame of payload) { 127 index++; 126 128 if (frame.functionName === "eval code") 127 129 break; 128 index++;129 130 } 130 131 return payload.slice(0, index); -
trunk/Source/WebInspectorUI/ChangeLog
r194066 r194083 1 2015-12-14 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Stack traces in console incorrectly show "(anonymous function)" for global code 4 https://bugs.webkit.org/show_bug.cgi?id=152280 5 6 Reviewed by Brian Burg. 7 8 * UserInterface/Images/Program.svg: Added. 9 * UserInterface/Images/gtk/Program.svg: Added. 10 Copied from TimelineRecordScriptEvaluated.svg. 11 12 * UserInterface/Models/CallFrame.js: 13 (WebInspector.CallFrame): 14 (WebInspector.CallFrame.prototype.get programCode): 15 Add a new property to check if this call frame is in program code. 16 17 (WebInspector.CallFrame.fromPayload): 18 Detect different sources of program code (global, eval, module). 19 20 * UserInterface/Views/CallFrameIcons.css: 21 (.program-icon .icon): 22 * UserInterface/Views/CallFrameView.js: 23 (WebInspector.CallFrameView.iconClassNameForCallFrame): 24 Give program code the [S] global script icon like in profiles. 25 1 26 2015-12-14 Joseph Pecoraro <pecoraro@apple.com> 2 27 -
trunk/Source/WebInspectorUI/UserInterface/Models/CallFrame.js
r188017 r194083 26 26 WebInspector.CallFrame = class CallFrame extends WebInspector.Object 27 27 { 28 constructor(id, sourceCodeLocation, functionName, thisObject, scopeChain, nativeCode )28 constructor(id, sourceCodeLocation, functionName, thisObject, scopeChain, nativeCode, programCode) 29 29 { 30 30 super(); … … 40 40 this._scopeChain = scopeChain || []; 41 41 this._nativeCode = nativeCode || false; 42 this._programCode = programCode || false; 42 43 } 43 44 … … 62 63 { 63 64 return this._nativeCode; 65 } 66 67 get programCode() 68 { 69 return this._programCode; 64 70 } 65 71 … … 109 115 var url = payload.url; 110 116 var nativeCode = false; 117 var programCode = false; 111 118 var sourceCodeLocation = null; 112 119 … … 126 133 } 127 134 128 var functionName = null; 129 if (payload.functionName !== "global code" && payload.functionName !== "eval code") 130 functionName = payload.functionName; 135 var functionName = payload.functionName; 136 if (payload.functionName === "global code" 137 || payload.functionName === "eval code" 138 || payload.functionName === "module code") 139 programCode = true; 131 140 132 return new WebInspector.CallFrame(null, sourceCodeLocation, functionName, null, null, nativeCode );141 return new WebInspector.CallFrame(null, sourceCodeLocation, functionName, null, null, nativeCode, programCode); 133 142 } 134 143 }; -
trunk/Source/WebInspectorUI/UserInterface/Views/CallFrameIcons.css
r164543 r194083 24 24 */ 25 25 26 .program-icon .icon { 27 content: url(../Images/Program.svg); 28 } 29 26 30 .function-icon .icon { 27 31 content: url(../Images/Function.svg); -
trunk/Source/WebInspectorUI/UserInterface/Views/CallFrameView.js
r188017 r194083 74 74 static iconClassNameForCallFrame(callFrame) 75 75 { 76 if (callFrame.programCode) 77 return WebInspector.CallFrameView.ProgramIconStyleClassName; 78 76 79 // This is more than likely an event listener function with an "on" prefix and it is 77 80 // as long or longer than the shortest event listener name -- "oncut". … … 86 89 }; 87 90 91 WebInspector.CallFrameView.ProgramIconStyleClassName = "program-icon"; 88 92 WebInspector.CallFrameView.FunctionIconStyleClassName = "function-icon"; 89 93 WebInspector.CallFrameView.EventListenerIconStyleClassName = "event-listener-icon";
Note: See TracChangeset
for help on using the changeset viewer.