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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sdk/ConsoleModel.js

Issue 2236033002: [DevTools] Simplify evaluation callbacks on frontend (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-was-thrown
Patch Set: addressed comments Created 4 years, 4 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 { 183 {
184 var target = executionContext.target(); 184 var target = executionContext.target();
185 var requestedText = text; 185 var requestedText = text;
186 186
187 var commandMessage = new WebInspector.ConsoleMessage(target, WebInspector.Co nsoleMessage.MessageSource.JS, null, text, WebInspector.ConsoleMessage.MessageTy pe.Command); 187 var commandMessage = new WebInspector.ConsoleMessage(target, WebInspector.Co nsoleMessage.MessageSource.JS, null, text, WebInspector.ConsoleMessage.MessageTy pe.Command);
188 commandMessage.setExecutionContextId(executionContext.id); 188 commandMessage.setExecutionContextId(executionContext.id);
189 target.consoleModel.addMessage(commandMessage); 189 target.consoleModel.addMessage(commandMessage);
190 190
191 /** 191 /**
192 * @param {?WebInspector.RemoteObject} result 192 * @param {?WebInspector.RemoteObject} result
193 * @param {boolean} wasThrown 193 * @param {!RuntimeAgent.ExceptionDetails=} exceptionDetails
194 * @param {?RuntimeAgent.RemoteObject=} valueResult
195 * @param {?RuntimeAgent.ExceptionDetails=} exceptionDetails
196 */ 194 */
197 function printResult(result, wasThrown, valueResult, exceptionDetails) 195 function printResult(result, exceptionDetails)
198 { 196 {
199 if (!result) 197 if (!result)
200 return; 198 return;
201 199
202 WebInspector.console.showPromise().then(reportUponEvaluation); 200 WebInspector.console.showPromise().then(reportUponEvaluation);
203 function reportUponEvaluation() 201 function reportUponEvaluation()
204 { 202 {
205 target.consoleModel.dispatchEventToListeners(WebInspector.ConsoleMod el.Events.CommandEvaluated, {result: result, wasThrown: wasThrown, text: request edText, commandMessage: commandMessage, exceptionDetails: exceptionDetails}); 203 target.consoleModel.dispatchEventToListeners(WebInspector.ConsoleMod el.Events.CommandEvaluated, {result: result, text: requestedText, commandMessage : commandMessage, exceptionDetails: exceptionDetails});
206 } 204 }
207 } 205 }
208 206
209 /** 207 /**
210 * @param {string} code 208 * @param {string} code
211 * @suppress {uselessCode} 209 * @suppress {uselessCode}
212 * @return {boolean} 210 * @return {boolean}
213 */ 211 */
214 function looksLikeAnObjectLiteral(code) 212 function looksLikeAnObjectLiteral(code)
215 { 213 {
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 this.dispatchEventToListeners(WebInspector.ConsoleModel.Events.CommandEv aluated, event.data); 613 this.dispatchEventToListeners(WebInspector.ConsoleModel.Events.CommandEv aluated, event.data);
616 }, 614 },
617 615
618 __proto__: WebInspector.Object.prototype 616 __proto__: WebInspector.Object.prototype
619 } 617 }
620 618
621 /** 619 /**
622 * @type {!WebInspector.MultitargetConsoleModel} 620 * @type {!WebInspector.MultitargetConsoleModel}
623 */ 621 */
624 WebInspector.multitargetConsoleModel; 622 WebInspector.multitargetConsoleModel;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698