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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 hiddenCallFramesCount += details.callFrames.length - items.length; | 89 hiddenCallFramesCount += details.callFrames.length - items.length; |
90 } | 90 } |
91 | 91 |
92 var asyncStackTrace = details.asyncStackTrace; | 92 var asyncStackTrace = details.asyncStackTrace; |
93 var peviousStackTrace = details.callFrames; | 93 var peviousStackTrace = details.callFrames; |
94 while (asyncStackTrace) { | 94 while (asyncStackTrace) { |
95 var title = ''; | 95 var title = ''; |
96 var isAwait = asyncStackTrace.description === 'async function'; | 96 var isAwait = asyncStackTrace.description === 'async function'; |
97 if (isAwait && peviousStackTrace.length && asyncStackTrace.callFrames.leng
th) { | 97 if (isAwait && peviousStackTrace.length && asyncStackTrace.callFrames.leng
th) { |
98 var lastPreviousFrame = peviousStackTrace[peviousStackTrace.length - 1]; | 98 var lastPreviousFrame = peviousStackTrace[peviousStackTrace.length - 1]; |
99 var topFrame = asyncStackTrace.callFrames[0]; | |
100 var lastPreviousFrameName = UI.beautifyFunctionName(lastPreviousFrame.fu
nctionName); | 99 var lastPreviousFrameName = UI.beautifyFunctionName(lastPreviousFrame.fu
nctionName); |
101 var topFrameName = UI.beautifyFunctionName(topFrame.functionName); | 100 title = UI.asyncStackTraceLabel('await in ' + lastPreviousFrameName); |
102 title = topFrameName + ' awaits ' + lastPreviousFrameName; | |
103 } else { | 101 } else { |
104 title = UI.asyncStackTraceLabel(asyncStackTrace.description); | 102 title = UI.asyncStackTraceLabel(asyncStackTrace.description); |
105 } | 103 } |
106 | 104 |
107 var asyncItems = asyncStackTrace.callFrames.map(frame => ({runtimeCallFram
e: frame})); | 105 var asyncItems = asyncStackTrace.callFrames.map(frame => ({runtimeCallFram
e: frame})); |
108 if (!showBlackboxed) { | 106 if (!showBlackboxed) { |
109 asyncItems = asyncItems.filter( | 107 asyncItems = asyncItems.filter( |
110 item => !Bindings.blackboxManager.isBlackboxedRawLocation( | 108 item => !Bindings.blackboxManager.isBlackboxedRawLocation( |
111 /** @type {!SDK.DebuggerModel.Location} */ (this._itemLocation(i
tem)))); | 109 /** @type {!SDK.DebuggerModel.Location} */ (this._itemLocation(i
tem)))); |
112 hiddenCallFramesCount += asyncStackTrace.callFrames.length - asyncItems.
length; | 110 hiddenCallFramesCount += asyncStackTrace.callFrames.length - asyncItems.
length; |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 | 385 |
388 /** | 386 /** |
389 * @typedef {{ | 387 * @typedef {{ |
390 * debuggerCallFrame: (SDK.DebuggerModel.CallFrame|undefined), | 388 * debuggerCallFrame: (SDK.DebuggerModel.CallFrame|undefined), |
391 * asyncStackHeader: (string|undefined), | 389 * asyncStackHeader: (string|undefined), |
392 * runtimeCallFrame: (Protocol.Runtime.CallFrame|undefined), | 390 * runtimeCallFrame: (Protocol.Runtime.CallFrame|undefined), |
393 * promiseCreationFrame: (Protocol.Runtime.CallFrame|undefined) | 391 * promiseCreationFrame: (Protocol.Runtime.CallFrame|undefined) |
394 * }} | 392 * }} |
395 */ | 393 */ |
396 Sources.CallStackSidebarPane.Item; | 394 Sources.CallStackSidebarPane.Item; |
OLD | NEW |