Chromium Code Reviews| 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 const asyncFunctionDesription = "async function"; | |
| 84 while (asyncStackTrace) { | 85 while (asyncStackTrace) { |
| 85 var title = WebInspector.asyncStackTraceLabel(asyncStackTrace.descri ption); | 86 var title = ""; |
| 87 if (asyncStackTrace.description === asyncFunctionDesription && async StackTrace.callFrames.length > 1) { | |
| 88 var redundantFrame = asyncStackTrace.callFrames.shift(); | |
|
dgozman
2016/10/20 21:37:07
Let's move model mutation to DebuggerModel.
kozy
2016/10/20 22:21:07
Done.
| |
| 89 var topFrame = asyncStackTrace.callFrames[0]; | |
| 90 var redundantFrameName = WebInspector.beautifyFunctionName(redun dantFrame.functionName); | |
| 91 var topFrameName = WebInspector.beautifyFunctionName(topFrame.fu nctionName); | |
| 92 title = topFrameName + " awaits " + redundantFrameName; | |
| 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); |
| 90 asyncStackTrace = asyncStackTrace.parent; | 100 asyncStackTrace = asyncStackTrace.parent; |
| 91 } | 101 } |
| 92 | 102 |
| 93 if (topStackHidden) | 103 if (topStackHidden) |
| 94 this._revealHiddenCallFrames(); | 104 this._revealHiddenCallFrames(); |
| 95 if (this._hiddenCallFrames) { | 105 if (this._hiddenCallFrames) { |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 488 var uiLocation = liveLocation.uiLocation(); | 498 var uiLocation = liveLocation.uiLocation(); |
| 489 if (!uiLocation) | 499 if (!uiLocation) |
| 490 return; | 500 return; |
| 491 var text = uiLocation.linkText(); | 501 var text = uiLocation.linkText(); |
| 492 this.setSubtitle(text.trimMiddle(30)); | 502 this.setSubtitle(text.trimMiddle(30)); |
| 493 this.subtitleElement.title = text; | 503 this.subtitleElement.title = text; |
| 494 }, | 504 }, |
| 495 | 505 |
| 496 __proto__: WebInspector.UIList.Item.prototype | 506 __proto__: WebInspector.UIList.Item.prototype |
| 497 } | 507 } |
| OLD | NEW |