Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js |
| index d8fa7126b96a79200ab6089ea39126e41824eb70..b39a9cd07e39e0f00483979848c56d0b8dc353c5 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js |
| @@ -62,9 +62,6 @@ WebInspector.DebuggerModel = function(target) |
| /** @typedef {{location: ?WebInspector.DebuggerModel.Location, sourceURL: ?string, functionName: string, scopeChain: (Array.<!DebuggerAgent.Scope>|null)}} */ |
| WebInspector.DebuggerModel.FunctionDetails; |
| -/** @typedef {{location: ?WebInspector.DebuggerModel.Location, sourceURL: ?string, functionName: string, status: string}} */ |
| -WebInspector.DebuggerModel.GeneratorObjectDetails; |
| - |
| /** |
| * Keep these in sync with WebCore::V8Debugger |
| * |
| @@ -718,29 +715,30 @@ WebInspector.DebuggerModel.prototype = { |
| /** |
| * @param {!WebInspector.RemoteObject} remoteObject |
| - * @param {function(?WebInspector.DebuggerModel.GeneratorObjectDetails)} callback |
| + * @return {!Promise<?WebInspector.DebuggerModel.Location>} |
| */ |
| - generatorObjectDetails: function(remoteObject, callback) |
| + generatorObjectLocation: function(remoteObject) |
|
dgozman
2016/07/07 00:44:34
I think we don't use this.
kozy
2016/07/07 17:58:02
Done.
|
| { |
| - this._agent.getGeneratorObjectDetails(remoteObject.objectId, didGetDetails.bind(this)); |
| + if (remoteObject.subtype !== "generator") |
| + return Promise.resolve(/** @type {?WebInspector.DebuggerModel.Location} */(null)); |
| + return remoteObject.getOwnPropertiesPromise().then(buildLocation.bind(this)); |
| /** |
| - * @param {?Protocol.Error} error |
| - * @param {!DebuggerAgent.GeneratorObjectDetails} response |
| - * @this {WebInspector.DebuggerModel} |
| + * @this {!WebInspector.DebuggerModel} |
| + * @param {!{properties: ?Array.<!WebInspector.RemoteObjectProperty>, internalProperties: ?Array.<!WebInspector.RemoteObjectProperty>}} response |
| + * @return {?WebInspector.DebuggerModel.Location} |
| */ |
| - function didGetDetails(error, response) |
| + function buildLocation(response) |
| { |
| - if (error) { |
| - console.error(error); |
| - callback(null); |
| - return; |
| + if (!response || !response.internalProperties) |
| + return null; |
| + for (var prop of response.internalProperties) { |
| + if (prop.name === "[[GeneratorLocation]]") { |
| + var loc = prop.value.value; |
| + return this.createRawLocationByScriptId(loc.scriptId, loc.lineNumber, loc.columnNumber); |
| + } |
| } |
| - var location = response.location; |
| - var script = location && this.scriptForId(location.scriptId); |
| - var rawLocation = script ? this.createRawLocation(script, location.lineNumber, location.columnNumber || 0) : null; |
| - var sourceURL = script ? script.contentURL() : null; |
| - callback({location: rawLocation, sourceURL: sourceURL, functionName: response.functionName, status: response.status}); |
| + return null; |
| } |
| }, |