| OLD | NEW |
| 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 1167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1178 } | 1178 } |
| 1179 this.debuggerModel._agent.invoke_evaluateOnCallFrame( | 1179 this.debuggerModel._agent.invoke_evaluateOnCallFrame( |
| 1180 { | 1180 { |
| 1181 callFrameId: this._payload.callFrameId, | 1181 callFrameId: this._payload.callFrameId, |
| 1182 expression: code, objectGroup, includeCommandLineAPI, silent, returnBy
Value, generatePreview | 1182 expression: code, objectGroup, includeCommandLineAPI, silent, returnBy
Value, generatePreview |
| 1183 }, | 1183 }, |
| 1184 didEvaluateOnCallFrame); | 1184 didEvaluateOnCallFrame); |
| 1185 } | 1185 } |
| 1186 | 1186 |
| 1187 /** | 1187 /** |
| 1188 * @param {string} code |
| 1189 * @param {string} objectGroup |
| 1190 * @param {boolean} includeCommandLineAPI |
| 1191 * @param {boolean} silent |
| 1192 * @param {boolean} returnByValue |
| 1193 * @param {boolean} generatePreview |
| 1194 * @return {!Promise<?SDK.RemoteObject>} |
| 1195 */ |
| 1196 evaluatePromise(code, objectGroup, includeCommandLineAPI, silent, returnByValu
e, generatePreview) { |
| 1197 var fulfill; |
| 1198 var promise = new Promise(x => fulfill = x); |
| 1199 this.evaluate( |
| 1200 code, objectGroup, includeCommandLineAPI, silent, returnByValue, generat
ePreview, callback.bind(this)); |
| 1201 return promise; |
| 1202 |
| 1203 /** |
| 1204 * @param {?Protocol.Runtime.RemoteObject} result |
| 1205 * @param {!Protocol.Runtime.ExceptionDetails=} exceptionDetails |
| 1206 * @param {string=} error |
| 1207 * @this {SDK.DebuggerModel.CallFrame} |
| 1208 */ |
| 1209 function callback(result, exceptionDetails, error) { |
| 1210 if (!result || exceptionDetails) |
| 1211 fulfill(null); |
| 1212 else |
| 1213 fulfill(this.debuggerModel._runtimeModel.createRemoteObject(result)); |
| 1214 } |
| 1215 } |
| 1216 |
| 1217 /** |
| 1188 * @param {function(?Protocol.Error=)=} callback | 1218 * @param {function(?Protocol.Error=)=} callback |
| 1189 */ | 1219 */ |
| 1190 restart(callback) { | 1220 restart(callback) { |
| 1191 /** | 1221 /** |
| 1192 * @param {?Protocol.Error} error | 1222 * @param {?Protocol.Error} error |
| 1193 * @param {!Array.<!Protocol.Debugger.CallFrame>=} callFrames | 1223 * @param {!Array.<!Protocol.Debugger.CallFrame>=} callFrames |
| 1194 * @param {!Protocol.Runtime.StackTrace=} asyncStackTrace | 1224 * @param {!Protocol.Runtime.StackTrace=} asyncStackTrace |
| 1195 * @this {SDK.DebuggerModel.CallFrame} | 1225 * @this {SDK.DebuggerModel.CallFrame} |
| 1196 */ | 1226 */ |
| 1197 function protocolCallback(error, callFrames, asyncStackTrace) { | 1227 function protocolCallback(error, callFrames, asyncStackTrace) { |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1361 stack.callFrames.shift(); | 1391 stack.callFrames.shift(); |
| 1362 if (previous && (!stack.callFrames.length && !stack.promiseCreationFrame)) | 1392 if (previous && (!stack.callFrames.length && !stack.promiseCreationFrame)) |
| 1363 previous.parent = stack.parent; | 1393 previous.parent = stack.parent; |
| 1364 else | 1394 else |
| 1365 previous = stack; | 1395 previous = stack; |
| 1366 stack = stack.parent; | 1396 stack = stack.parent; |
| 1367 } | 1397 } |
| 1368 return asyncStackTrace; | 1398 return asyncStackTrace; |
| 1369 } | 1399 } |
| 1370 }; | 1400 }; |
| OLD | NEW |