return this._scriptSyntaxTree;
},
- canRequestContentFromBackend: function()
- {
- // We can request content if we have an id.
- return !!this._id;
- },
-
requestContentFromBackend: function(callback)
{
if (!this._id) {
// There is no identifier to request content with. Return false to cause the
// pending callbacks to get null content.
- return false;
+ return Promise.reject({ message: "There is no identifier to request content with." });
}
- DebuggerAgent.getScriptSource(this._id, callback);
- return true;
+ return DebuggerAgent.getScriptSource.promise(this._id);
},
saveIdentityToCookie: function(cookie)
return;
}
- this.requestContent(function(error, sourceText) {
- makeSyntaxTreeAndCallCallback(error ? null : sourceText);
+ this.requestContent().then(function(parameters) {
+ makeSyntaxTreeAndCallCallback(parameters.content);
+ }).catch(function(error) {
+ makeSyntaxTreeAndCallCallback(null);
});
},