[Pkg-mozext-commits] [firebug] 35/59: Fix stringification of xrayed functions on Fx32- (related to issue 7597)

David Prévot taffit at moszumanska.debian.org
Thu Aug 14 14:52:56 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 6f416348e247c264ad6567750378a7ab4daec862
Author: Simon Lindholm <simon.lindholm10 at gmail.com>
Date:   Wed Jul 30 20:50:27 2014 +0200

    Fix stringification of xrayed functions on Fx32- (related to issue 7597)
---
 extension/content/firebug/chrome/reps.js | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/extension/content/firebug/chrome/reps.js b/extension/content/firebug/chrome/reps.js
index 9e22d2f..b8fc503 100644
--- a/extension/content/firebug/chrome/reps.js
+++ b/extension/content/firebug/chrome/reps.js
@@ -230,13 +230,18 @@ FirebugReps.Func = domplate(Rep,
 
     summarizeFunction: function(fn)
     {
-        var fnText = Str.safeToString(fn);
+        // XXX For now, use unwrappedFn for stringification, because an X-rayed
+        // "Window" constructor otherwise serializes as
+        // [object XrayWrapper function Window() { [native code] }]
+        // in Firefox 32 and below.
+        var unwrappedFn = Wrapper.unwrapObject(fn);
+        var fnText = Str.safeToString(unwrappedFn);
         var regularFn = /^function\s*([^(]*)(\([^)]*\))/.exec(fnText);
         var result;
         if (regularFn)
         {
             // XXX use Debugger.Object.displayName here?
-            var displayName = Wrapper.unwrapObject(fn).displayName;
+            var displayName = unwrappedFn.displayName;
             var name = regularFn[1] || displayName || "function";
             if (name == "anonymous" && displayName)
                 name = displayName;

-- 
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