Bug 1020948 - Ensure fetching script sources when DebuggerObject.source fails. r=past

This commit is contained in:
Alexandre Poirot 2014-06-26 06:39:00 +02:00
parent 7ccc46ba56
commit bd01301016

View File

@ -39,7 +39,8 @@ let addonManager = null;
* about them.
*/
function mapURIToAddonID(uri, id) {
if ((Services.appinfo.ID || undefined) == B2G_ID) {
if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT ||
(Services.appinfo.ID || undefined) == B2G_ID) {
return false;
}
@ -5058,7 +5059,13 @@ ThreadSources.prototype = {
.QueryInterface(Ci.nsIURL);
if (url.fileExtension === "js") {
spec.contentType = "text/javascript";
spec.text = aScript.source.text;
// If the Debugger API wasn't able to load the source,
// because sources were discarded
// (javascript.options.discardSystemSource == true),
// give source() a chance to fetch them.
if (aScript.source.text != "[no source]") {
spec.text = aScript.source.text;
}
}
} catch(ex) {
// Not a valid URI.