Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js

Issue 1770263002: Devtools: resolve expressions in minified scripts with sourcemaps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 while (startHighlight > 1 && line.charAt(startHighlight - 1) === '.' ) { 563 while (startHighlight > 1 && line.charAt(startHighlight - 1) === '.' ) {
564 var token = this.textEditor.tokenAtTextPosition(lineNumber, star tHighlight - 2); 564 var token = this.textEditor.tokenAtTextPosition(lineNumber, star tHighlight - 2);
565 if (!token || !token.type) { 565 if (!token || !token.type) {
566 this._popoverHelper.hidePopover(); 566 this._popoverHelper.hidePopover();
567 return; 567 return;
568 } 568 }
569 startHighlight = token.startColumn; 569 startHighlight = token.startColumn;
570 } 570 }
571 } 571 }
572 var evaluationText = line.substring(startHighlight, endHighlight + 1); 572 var evaluationText = line.substring(startHighlight, endHighlight + 1);
573 var selectedCallFrame = debuggerModel.selectedCallFrame(); 573 var selectedCallFrame = /** @type {!WebInspector.DebuggerModel.CallFrame }*/ (debuggerModel.selectedCallFrame());
574 selectedCallFrame.evaluate(evaluationText, objectGroupName, false, true, false, false, showObjectPopover.bind(this)); 574
575 WebInspector.SourceMapNamesResolver.resolveExpression(selectedCallFrame, evaluationText, this.uiSourceCode(), lineNumber, startHighlight, endHighlight). then(onResolve.bind(this));
576
577 /**
578 * @param {?string=} text
579 * @this {WebInspector.JavaScriptSourceFrame}
580 */
581 function onResolve(text)
582 {
583 selectedCallFrame.evaluate(text || evaluationText, objectGroupName, false, true, false, false, showObjectPopover.bind(this));
584 }
575 585
576 /** 586 /**
577 * @param {?RuntimeAgent.RemoteObject} result 587 * @param {?RuntimeAgent.RemoteObject} result
578 * @param {boolean=} wasThrown 588 * @param {boolean=} wasThrown
579 * @this {WebInspector.JavaScriptSourceFrame} 589 * @this {WebInspector.JavaScriptSourceFrame}
580 */ 590 */
581 function showObjectPopover(result, wasThrown) 591 function showObjectPopover(result, wasThrown)
582 { 592 {
583 var target = WebInspector.context.flavor(WebInspector.Target); 593 var target = WebInspector.context.flavor(WebInspector.Target);
584 if (selectedCallFrame.target() != target || !debuggerModel.isPaused( ) || !result) { 594 if (selectedCallFrame.target() != target || !debuggerModel.isPaused( ) || !result) {
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
1119 this.uiSourceCode().removeEventListener(WebInspector.UISourceCode.Events .WorkingCopyChanged, this._workingCopyChanged, this); 1129 this.uiSourceCode().removeEventListener(WebInspector.UISourceCode.Events .WorkingCopyChanged, this._workingCopyChanged, this);
1120 this.uiSourceCode().removeEventListener(WebInspector.UISourceCode.Events .WorkingCopyCommitted, this._workingCopyCommitted, this); 1130 this.uiSourceCode().removeEventListener(WebInspector.UISourceCode.Events .WorkingCopyCommitted, this._workingCopyCommitted, this);
1121 this.uiSourceCode().removeEventListener(WebInspector.UISourceCode.Events .TitleChanged, this._showBlackboxInfobarIfNeeded, this); 1131 this.uiSourceCode().removeEventListener(WebInspector.UISourceCode.Events .TitleChanged, this._showBlackboxInfobarIfNeeded, this);
1122 WebInspector.moduleSetting("skipStackFramesPattern").removeChangeListene r(this._showBlackboxInfobarIfNeeded, this); 1132 WebInspector.moduleSetting("skipStackFramesPattern").removeChangeListene r(this._showBlackboxInfobarIfNeeded, this);
1123 WebInspector.moduleSetting("skipContentScripts").removeChangeListener(th is._showBlackboxInfobarIfNeeded, this); 1133 WebInspector.moduleSetting("skipContentScripts").removeChangeListener(th is._showBlackboxInfobarIfNeeded, this);
1124 WebInspector.UISourceCodeFrame.prototype.dispose.call(this); 1134 WebInspector.UISourceCodeFrame.prototype.dispose.call(this);
1125 }, 1135 },
1126 1136
1127 __proto__: WebInspector.UISourceCodeFrame.prototype 1137 __proto__: WebInspector.UISourceCodeFrame.prototype
1128 } 1138 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698