[Pkg-mozext-commits] [firebug] 29/56: Add support for functions to Wrapper.cloneIntoContentScope

David Prévot taffit at moszumanska.debian.org
Wed Nov 19 21:01:44 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 2cc992b9cc07263e70a805f61234bb633c4b169d
Author: Simon Lindholm <simon.lindholm10 at gmail.com>
Date:   Wed Oct 22 22:57:42 2014 +0200

    Add support for functions to Wrapper.cloneIntoContentScope
---
 extension/content/firebug/lib/wrapper.js | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/extension/content/firebug/lib/wrapper.js b/extension/content/firebug/lib/wrapper.js
index 0d45e13..142ee76 100644
--- a/extension/content/firebug/lib/wrapper.js
+++ b/extension/content/firebug/lib/wrapper.js
@@ -59,14 +59,16 @@ Wrapper.isChromeObject = function(obj, chromeWin)
 };
 
 /**
- * Create a content-accessible view of a simple chrome object. All properties
- * are marked as non-writable, except if they have explicit getters/setters.
+ * Create a content-accessible view of a simple chrome object or function. All
+ * properties are marked as non-writable, except if they have explicit getters/setters.
  */
 Wrapper.cloneIntoContentScope = function(global, obj)
 {
+    global = Wrapper.wrapObject(global);
+    if (typeof obj === "function")
+        return cloneFunction(global, obj);
     if (!obj || typeof obj !== "object")
         return obj;
-    global = Wrapper.wrapObject(global);
     var newObj = (Array.isArray(obj) ? new global.Array() : new global.Object());
     newObj = XPCNativeWrapper.unwrap(newObj);
     for (var prop in obj)

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