OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 if (!details) { | 74 if (!details) { |
75 WebInspector.context.setFlavor(WebInspector.DebuggerModel.CallFrame,
null); | 75 WebInspector.context.setFlavor(WebInspector.DebuggerModel.CallFrame,
null); |
76 return; | 76 return; |
77 } | 77 } |
78 this._debuggerModel = details.debuggerModel; | 78 this._debuggerModel = details.debuggerModel; |
79 var asyncStackTrace = details.asyncStackTrace; | 79 var asyncStackTrace = details.asyncStackTrace; |
80 | 80 |
81 this._appendSidebarCallFrames(this._callFramesFromDebugger(details.callF
rames)); | 81 this._appendSidebarCallFrames(this._callFramesFromDebugger(details.callF
rames)); |
82 var topStackHidden = (this._hiddenCallFrames === this.callFrames.length)
; | 82 var topStackHidden = (this._hiddenCallFrames === this.callFrames.length)
; |
83 | 83 |
| 84 var peviousStackTrace = details.callFrames; |
84 while (asyncStackTrace) { | 85 while (asyncStackTrace) { |
85 var title = WebInspector.asyncStackTraceLabel(asyncStackTrace.descri
ption); | 86 var title = ""; |
| 87 if (asyncStackTrace.description === "async function") { |
| 88 var lastPreviousFrame = peviousStackTrace[peviousStackTrace.leng
th - 1]; |
| 89 var topFrame = asyncStackTrace.callFrames[0]; |
| 90 var lastPreviousFrameName = WebInspector.beautifyFunctionName(la
stPreviousFrame.functionName); |
| 91 var topFrameName = WebInspector.beautifyFunctionName(topFrame.fu
nctionName); |
| 92 title = topFrameName + " awaits " + lastPreviousFrameName; |
| 93 } else { |
| 94 title = WebInspector.asyncStackTraceLabel(asyncStackTrace.descri
ption); |
| 95 } |
86 var asyncCallFrame = new WebInspector.UIList.Item(title, "", true); | 96 var asyncCallFrame = new WebInspector.UIList.Item(title, "", true); |
87 asyncCallFrame.setHoverable(false); | 97 asyncCallFrame.setHoverable(false); |
88 asyncCallFrame.element.addEventListener("contextmenu", this._asyncCa
llFrameContextMenu.bind(this, this.callFrames.length), true); | 98 asyncCallFrame.element.addEventListener("contextmenu", this._asyncCa
llFrameContextMenu.bind(this, this.callFrames.length), true); |
89 this._appendSidebarCallFrames(this._callFramesFromRuntime(asyncStack
Trace.callFrames, asyncCallFrame), asyncCallFrame); | 99 this._appendSidebarCallFrames(this._callFramesFromRuntime(asyncStack
Trace.callFrames, asyncCallFrame), asyncCallFrame); |
| 100 peviousStackTrace = asyncStackTrace.callFrames; |
90 asyncStackTrace = asyncStackTrace.parent; | 101 asyncStackTrace = asyncStackTrace.parent; |
91 } | 102 } |
92 | 103 |
93 if (topStackHidden) | 104 if (topStackHidden) |
94 this._revealHiddenCallFrames(); | 105 this._revealHiddenCallFrames(); |
95 if (this._hiddenCallFrames) { | 106 if (this._hiddenCallFrames) { |
96 var element = createElementWithClass("div", "hidden-callframes-messa
ge"); | 107 var element = createElementWithClass("div", "hidden-callframes-messa
ge"); |
97 if (this._hiddenCallFrames === 1) | 108 if (this._hiddenCallFrames === 1) |
98 element.textContent = WebInspector.UIString("1 stack frame is hi
dden (black-boxed)."); | 109 element.textContent = WebInspector.UIString("1 stack frame is hi
dden (black-boxed)."); |
99 else | 110 else |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 var uiLocation = liveLocation.uiLocation(); | 499 var uiLocation = liveLocation.uiLocation(); |
489 if (!uiLocation) | 500 if (!uiLocation) |
490 return; | 501 return; |
491 var text = uiLocation.linkText(); | 502 var text = uiLocation.linkText(); |
492 this.setSubtitle(text.trimMiddle(30)); | 503 this.setSubtitle(text.trimMiddle(30)); |
493 this.subtitleElement.title = text; | 504 this.subtitleElement.title = text; |
494 }, | 505 }, |
495 | 506 |
496 __proto__: WebInspector.UIList.Item.prototype | 507 __proto__: WebInspector.UIList.Item.prototype |
497 } | 508 } |
OLD | NEW |