From 48afadd23ebd0ee5b5129b88496d0eebfbfa4ecd Mon Sep 17 00:00:00 2001 From: Alexandre Poirot Date: Thu, 26 Jun 2014 06:39:00 +0200 Subject: [PATCH] Bug 1020948 - Ensure fetching script sources when DebuggerObject.source fails. r=past --- toolkit/devtools/server/actors/script.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/toolkit/devtools/server/actors/script.js b/toolkit/devtools/server/actors/script.js index 3f83b5fe2d6..a90980d08c1 100644 --- a/toolkit/devtools/server/actors/script.js +++ b/toolkit/devtools/server/actors/script.js @@ -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.