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

Side by Side Diff: Source/devtools/front_end/sdk/ConsoleModel.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) 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 useCommandLineAPI = !!useCommandLineAPI; 168 useCommandLineAPI = !!useCommandLineAPI;
169 var target = executionContext.target(); 169 var target = executionContext.target();
170 170
171 var commandMessage = new WebInspector.ConsoleMessage(target, WebInspector.Co nsoleMessage.MessageSource.JS, null, text, WebInspector.ConsoleMessage.MessageTy pe.Command); 171 var commandMessage = new WebInspector.ConsoleMessage(target, WebInspector.Co nsoleMessage.MessageSource.JS, null, text, WebInspector.ConsoleMessage.MessageTy pe.Command);
172 target.consoleModel.addMessage(commandMessage); 172 target.consoleModel.addMessage(commandMessage);
173 173
174 /** 174 /**
175 * @param {?WebInspector.RemoteObject} result 175 * @param {?WebInspector.RemoteObject} result
176 * @param {boolean} wasThrown 176 * @param {boolean} wasThrown
177 * @param {?RuntimeAgent.RemoteObject=} valueResult 177 * @param {?RuntimeAgent.RemoteObject=} valueResult
178 * @param {?DebuggerAgent.ExceptionDetails=} exceptionDetails
178 * @this {WebInspector.ConsoleModel} 179 * @this {WebInspector.ConsoleModel}
179 */ 180 */
180 function printResult(result, wasThrown, valueResult) 181 function printResult(result, wasThrown, valueResult, exceptionDetails)
181 { 182 {
182 if (!result) 183 if (!result)
183 return; 184 return;
184 185
185 this.dispatchEventToListeners(WebInspector.ConsoleModel.Events.CommandEv aluated, {result: result, wasThrown: wasThrown, text: text, commandMessage: comm andMessage}); 186 this.dispatchEventToListeners(WebInspector.ConsoleModel.Events.CommandEv aluated, {result: result, wasThrown: wasThrown, text: text, commandMessage: comm andMessage, exceptionDetails: exceptionDetails});
186 } 187 }
187 188
188 executionContext.evaluate(text, "console", useCommandLineAPI, false, false, true, printResult.bind(target.consoleModel)); 189 executionContext.evaluate(text, "console", useCommandLineAPI, false, false, true, printResult.bind(target.consoleModel));
189 190
190 WebInspector.userMetrics.ConsoleEvaluated.record(); 191 WebInspector.userMetrics.ConsoleEvaluated.record();
191 } 192 }
192 193
193 194
194 /** 195 /**
195 * @constructor 196 * @constructor
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 { 459 {
459 if (!WebInspector.settings.preserveConsoleLog.get()) 460 if (!WebInspector.settings.preserveConsoleLog.get())
460 this._console.clearMessages(); 461 this._console.clearMessages();
461 } 462 }
462 } 463 }
463 464
464 /** 465 /**
465 * @type {!WebInspector.ConsoleModel} 466 * @type {!WebInspector.ConsoleModel}
466 */ 467 */
467 WebInspector.console; 468 WebInspector.console;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698