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

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

Issue 2234983002: [DevTools] Removed wasThrown from evaluate-like protocol methods (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: a 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 * @param {boolean=} generatePreview 249 * @param {boolean=} generatePreview
250 * @param {boolean=} awaitPromise 250 * @param {boolean=} awaitPromise
251 * @param {function(?RuntimeAgent.RemoteObject, ?RuntimeAgent.ExceptionDetai ls=)=} callback 251 * @param {function(?RuntimeAgent.RemoteObject, ?RuntimeAgent.ExceptionDetai ls=)=} callback
252 */ 252 */
253 runScript: function(scriptId, executionContextId, objectGroup, doNotPauseOnE xceptionsAndMuteConsole, includeCommandLineAPI, returnByValue, generatePreview, awaitPromise, callback) 253 runScript: function(scriptId, executionContextId, objectGroup, doNotPauseOnE xceptionsAndMuteConsole, includeCommandLineAPI, returnByValue, generatePreview, awaitPromise, callback)
254 { 254 {
255 this._agent.runScript(scriptId, executionContextId, objectGroup, doNotPa useOnExceptionsAndMuteConsole, includeCommandLineAPI, returnByValue, generatePre view, awaitPromise, innerCallback); 255 this._agent.runScript(scriptId, executionContextId, objectGroup, doNotPa useOnExceptionsAndMuteConsole, includeCommandLineAPI, returnByValue, generatePre view, awaitPromise, innerCallback);
256 256
257 /** 257 /**
258 * @param {?Protocol.Error} error 258 * @param {?Protocol.Error} error
259 * @param {?RuntimeAgent.RemoteObject} result 259 * @param {!RuntimeAgent.RemoteObject} result
260 * @param {boolean=} wasThrown 260 * @param {!RuntimeAgent.ExceptionDetails=} exceptionDetails
261 * @param {?RuntimeAgent.ExceptionDetails=} exceptionDetails
262 */ 261 */
263 function innerCallback(error, result, wasThrown, exceptionDetails) 262 function innerCallback(error, result, exceptionDetails)
264 { 263 {
265 if (error) { 264 if (error) {
266 console.error(error); 265 console.error(error);
267 return; 266 return;
268 } 267 }
269 if (callback) 268 if (callback)
270 callback(result, exceptionDetails); 269 callback(result, exceptionDetails);
271 } 270 }
272 }, 271 },
273 272
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 { 588 {
590 if (!expression) { 589 if (!expression) {
591 // There is no expression, so the completion should happen against g lobal properties. 590 // There is no expression, so the completion should happen against g lobal properties.
592 expression = "this"; 591 expression = "this";
593 } 592 }
594 593
595 /** 594 /**
596 * @this {WebInspector.ExecutionContext} 595 * @this {WebInspector.ExecutionContext}
597 * @param {?Protocol.Error} error 596 * @param {?Protocol.Error} error
598 * @param {!RuntimeAgent.RemoteObject} result 597 * @param {!RuntimeAgent.RemoteObject} result
599 * @param {boolean=} wasThrown 598 * @param {!RuntimeAgent.ExceptionDetails=} exceptionDetails
600 * @param {?RuntimeAgent.ExceptionDetails=} exceptionDetails
601 */ 599 */
602 function evalCallback(error, result, wasThrown, exceptionDetails) 600 function evalCallback(error, result, exceptionDetails)
603 { 601 {
604 if (error) { 602 if (error) {
605 console.error(error); 603 console.error(error);
606 callback(null, false); 604 callback(null, false);
607 return; 605 return;
608 } 606 }
609 607
608 var wasThrown = !!exceptionDetails;
610 if (returnByValue) 609 if (returnByValue)
611 callback(null, !!wasThrown, wasThrown ? null : result, exception Details); 610 callback(null, !!wasThrown, wasThrown ? null : result, exception Details);
612 else 611 else
613 callback(this.runtimeModel.createRemoteObject(result), !!wasThro wn, undefined, exceptionDetails); 612 callback(this.runtimeModel.createRemoteObject(result), !!wasThro wn, undefined, exceptionDetails);
614 } 613 }
615 this.target().runtimeAgent().evaluate(expression, objectGroup, includeCo mmandLineAPI, doNotPauseOnExceptionsAndMuteConsole, this.id, returnByValue, gene ratePreview, userGesture, false, evalCallback.bind(this)); 614 this.target().runtimeAgent().evaluate(expression, objectGroup, includeCo mmandLineAPI, doNotPauseOnExceptionsAndMuteConsole, this.id, returnByValue, gene ratePreview, userGesture, false, evalCallback.bind(this));
616 }, 615 },
617 616
618 /** 617 /**
619 * @param {string} expressionString 618 * @param {string} expressionString
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
1028 /** 1027 /**
1029 * @return {boolean} 1028 * @return {boolean}
1030 */ 1029 */
1031 isNormalListenerType: function() 1030 isNormalListenerType: function()
1032 { 1031 {
1033 return this._listenerType === "normal"; 1032 return this._listenerType === "normal";
1034 }, 1033 },
1035 1034
1036 __proto__: WebInspector.SDKObject.prototype 1035 __proto__: WebInspector.SDKObject.prototype
1037 } 1036 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698