[Pkg-mozext-commits] [firebug] 10/56: Issue 7655: Script panel causes 'Unresponsive script' dialog for sourceTool.js
David Prévot
taffit at moszumanska.debian.org
Wed Nov 19 21:01:41 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository firebug.
commit ce0f78f0036bbffff1f49384cba2697c159635b1
Author: Florent FAYOLLE <florent.fayolle69 at gmail.com>
Date: Tue Sep 23 20:55:22 2014 +0200
Issue 7655: Script panel causes 'Unresponsive script' dialog for sourceTool.js
---
extension/content/firebug/debugger/script/sourceTool.js | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/extension/content/firebug/debugger/script/sourceTool.js b/extension/content/firebug/debugger/script/sourceTool.js
index a13f2df..077a212 100644
--- a/extension/content/firebug/debugger/script/sourceTool.js
+++ b/extension/content/firebug/debugger/script/sourceTool.js
@@ -495,6 +495,9 @@ DynamicSourceCollector.prototype =
}
sourceFile.scripts.push(script);
+ // Keep the length of the first original source.
+ // It is used to optimize the comparison of two sources in computeDynamicUrl.
+ sourceFile.originalSourceLength = script.source ? script.source.text.length : undefined;
// Initialize breakpoints for the new script.
var bps = BreakpointStore.getBreakpoints(sourceFile.href);
@@ -786,12 +789,18 @@ function computeDynamicUrl(script, context)
sourceFile.otherUniqueUrlsAtSameLocation = [uniqueUrl];
// Lookup the matching source files.
+ var newScriptLength = script.source.text.length;
var matchingSourceFileUrl = sourceFile.otherUniqueUrlsAtSameLocation.find((url) =>
{
var sf = context.getSourceFile(url);
- return sf.scripts && sf.scripts.length > 0 &&
- (sf.scripts[0].source === script.source ||
- sf.scripts[0].source.text === script.source.text);
+
+ if (!sf.scripts || sf.scripts.length === 0)
+ return;
+
+ var curScript = sf.scripts[0];
+ return curScript.source === script.source ||
+ sf.originalSourceLength === newScriptLength &&
+ curScript.source.text === script.source.text;
});
if (matchingSourceFileUrl)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/firebug.git
More information about the Pkg-mozext-commits
mailing list