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

Side by Side Diff: Source/devtools/front_end/sdk/DebuggerModel.js

Issue 369333002: DevTools: Added error message when the command is invoked from the console with exception (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@add-evaluate-exception-details
Patch Set: Created 6 years, 5 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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 return this._selectedCallFrame; 593 return this._selectedCallFrame;
594 }, 594 },
595 595
596 /** 596 /**
597 * @param {string} code 597 * @param {string} code
598 * @param {string} objectGroup 598 * @param {string} objectGroup
599 * @param {boolean} includeCommandLineAPI 599 * @param {boolean} includeCommandLineAPI
600 * @param {boolean} doNotPauseOnExceptionsAndMuteConsole 600 * @param {boolean} doNotPauseOnExceptionsAndMuteConsole
601 * @param {boolean} returnByValue 601 * @param {boolean} returnByValue
602 * @param {boolean} generatePreview 602 * @param {boolean} generatePreview
603 * @param {function(?WebInspector.RemoteObject, boolean, ?RuntimeAgent.Remot eObject=)} callback 603 * @param {function(?WebInspector.RemoteObject, boolean, ?RuntimeAgent.Remot eObject=, ?DebuggerAgent.ExceptionDetails=)} callback
604 */ 604 */
605 evaluateOnSelectedCallFrame: function(code, objectGroup, includeCommandLineA PI, doNotPauseOnExceptionsAndMuteConsole, returnByValue, generatePreview, callba ck) 605 evaluateOnSelectedCallFrame: function(code, objectGroup, includeCommandLineA PI, doNotPauseOnExceptionsAndMuteConsole, returnByValue, generatePreview, callba ck)
606 { 606 {
607 /** 607 /**
608 * @param {?RuntimeAgent.RemoteObject} result 608 * @param {?RuntimeAgent.RemoteObject} result
609 * @param {boolean=} wasThrown 609 * @param {boolean=} wasThrown
610 * @param {?DebuggerAgent.ExceptionDetails=} exceptionDetails
610 * @this {WebInspector.DebuggerModel} 611 * @this {WebInspector.DebuggerModel}
611 */ 612 */
612 function didEvaluate(result, wasThrown) 613 function didEvaluate(result, wasThrown, exceptionDetails)
613 { 614 {
614 if (!result) 615 if (!result)
615 callback(null, false); 616 callback(null, false);
616 else if (returnByValue) 617 else if (returnByValue)
617 callback(null, !!wasThrown, wasThrown ? null : result); 618 callback(null, !!wasThrown, wasThrown ? null : result, exception Details);
618 else 619 else
619 callback(this.target().runtimeModel.createRemoteObject(result), !!wasThrown); 620 callback(this.target().runtimeModel.createRemoteObject(result), !!wasThrown, undefined, exceptionDetails);
620 621
621 if (objectGroup === "console") 622 if (objectGroup === "console")
622 this.dispatchEventToListeners(WebInspector.DebuggerModel.Events. ConsoleCommandEvaluatedInSelectedCallFrame); 623 this.dispatchEventToListeners(WebInspector.DebuggerModel.Events. ConsoleCommandEvaluatedInSelectedCallFrame);
623 } 624 }
624 625
625 this.selectedCallFrame().evaluate(code, objectGroup, includeCommandLineA PI, doNotPauseOnExceptionsAndMuteConsole, returnByValue, generatePreview, didEva luate.bind(this)); 626 this.selectedCallFrame().evaluate(code, objectGroup, includeCommandLineA PI, doNotPauseOnExceptionsAndMuteConsole, returnByValue, generatePreview, didEva luate.bind(this));
626 }, 627 },
627 628
628 /** 629 /**
629 * @param {function(!Object)} callback 630 * @param {function(!Object)} callback
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
1029 return !!this._isAsync; 1030 return !!this._isAsync;
1030 }, 1031 },
1031 1032
1032 /** 1033 /**
1033 * @param {string} code 1034 * @param {string} code
1034 * @param {string} objectGroup 1035 * @param {string} objectGroup
1035 * @param {boolean} includeCommandLineAPI 1036 * @param {boolean} includeCommandLineAPI
1036 * @param {boolean} doNotPauseOnExceptionsAndMuteConsole 1037 * @param {boolean} doNotPauseOnExceptionsAndMuteConsole
1037 * @param {boolean} returnByValue 1038 * @param {boolean} returnByValue
1038 * @param {boolean} generatePreview 1039 * @param {boolean} generatePreview
1039 * @param {function(?RuntimeAgent.RemoteObject, boolean=)=} callback 1040 * @param {function(?RuntimeAgent.RemoteObject, boolean=, ?DebuggerAgent.Exc eptionDetails=)} callback
1040 */ 1041 */
1041 evaluate: function(code, objectGroup, includeCommandLineAPI, doNotPauseOnExc eptionsAndMuteConsole, returnByValue, generatePreview, callback) 1042 evaluate: function(code, objectGroup, includeCommandLineAPI, doNotPauseOnExc eptionsAndMuteConsole, returnByValue, generatePreview, callback)
1042 { 1043 {
1043 /** 1044 /**
1044 * @param {?Protocol.Error} error 1045 * @param {?Protocol.Error} error
1045 * @param {!RuntimeAgent.RemoteObject} result 1046 * @param {!RuntimeAgent.RemoteObject} result
1046 * @param {boolean=} wasThrown 1047 * @param {boolean=} wasThrown
1048 * @param {?DebuggerAgent.ExceptionDetails=} exceptionDetails
1047 */ 1049 */
1048 function didEvaluateOnCallFrame(error, result, wasThrown) 1050 function didEvaluateOnCallFrame(error, result, wasThrown, exceptionDetai ls)
1049 { 1051 {
1050 if (error) { 1052 if (error) {
1051 console.error(error); 1053 console.error(error);
1052 callback(null, false); 1054 callback(null, false);
1053 return; 1055 return;
1054 } 1056 }
1055 callback(result, wasThrown); 1057 callback(result, wasThrown, exceptionDetails);
1056 } 1058 }
1057 this._debuggerAgent.evaluateOnCallFrame(this._payload.callFrameId, code, objectGroup, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, retur nByValue, generatePreview, didEvaluateOnCallFrame); 1059 this._debuggerAgent.evaluateOnCallFrame(this._payload.callFrameId, code, objectGroup, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, retur nByValue, generatePreview, didEvaluateOnCallFrame);
1058 }, 1060 },
1059 1061
1060 /** 1062 /**
1061 * @param {function(?Protocol.Error=)=} callback 1063 * @param {function(?Protocol.Error=)=} callback
1062 */ 1064 */
1063 restart: function(callback) 1065 restart: function(callback)
1064 { 1066 {
1065 /** 1067 /**
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
1179 this.asyncStackTrace.dispose(); 1181 this.asyncStackTrace.dispose();
1180 }, 1182 },
1181 1183
1182 __proto__: WebInspector.TargetAware.prototype 1184 __proto__: WebInspector.TargetAware.prototype
1183 } 1185 }
1184 1186
1185 /** 1187 /**
1186 * @type {!WebInspector.DebuggerModel} 1188 * @type {!WebInspector.DebuggerModel}
1187 */ 1189 */
1188 WebInspector.debuggerModel; 1190 WebInspector.debuggerModel;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698