[Pkg-mozext-commits] [firebug] 22/82: Fix showing "prototype" for functions
David Prévot
taffit at moszumanska.debian.org
Mon Mar 31 22:45:37 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to tag fbtest-1.11.2
in repository firebug.
commit 524033d66c2cc4f37a9192f02356cb44d2b2d593
Author: Simon Lindholm <simon.lindholm10 at gmail.com>
Date: Wed Dec 19 17:37:27 2012 +0100
Fix showing "prototype" for functions
---
extension/content/firebug/dom/domPanel.js | 35 +++++++++++++------------------
1 file changed, 15 insertions(+), 20 deletions(-)
diff --git a/extension/content/firebug/dom/domPanel.js b/extension/content/firebug/dom/domPanel.js
index 055169e..eed73f1 100644
--- a/extension/content/firebug/dom/domPanel.js
+++ b/extension/content/firebug/dom/domPanel.js
@@ -456,27 +456,22 @@ Firebug.DOMBasePanel.prototype = Obj.extend(Firebug.Panel,
Firebug.showEnumerableProperties, Firebug.showOwnProperties);
properties = Arr.sortUnique(properties);
- var hOP = Object.prototype.hasOwnProperty;
- if (hOP.call(contentView, "constructor") &&
- properties.indexOf("constructor") == -1)
+ var addOwn = function(prop)
{
- properties.push("constructor");
- }
-
- if (hOP.call(contentView, "prototype") &&
- properties.indexOf("prototype") == -1)
- {
- properties.push("prototype");
- }
-
- if (hOP.call(contentView, "wrappedJSObject") &&
- properties.indexOf("wrappedJSObject") == -1)
- {
- properties.push("wrappedJSObject");
- }
+ // Apparently, Object.prototype.hasOwnProperty.call(contentView, p) lies
+ // when 'contentView' is content and 'Object' is chrome... Bug 658909?
+ if (Object.getOwnPropertyDescriptor(contentView, prop) &&
+ properties.indexOf(prop) === -1)
+ {
+ properties.push(prop);
+ }
+ };
+ addOwn("constructor");
+ addOwn("prototype");
+ addOwn("wrappedJSObject");
- // If showOwnProperties is false the __proto__ can be already in.
- // If showOwnProperties is true the __proto__ should not be in.
+ // __proto__ never shows in enumerations, so add it here. We currently
+ // we don't want it when only showing own properties.
if (contentView.__proto__ && Obj.hasProperties(contentView.__proto__) &&
properties.indexOf("__proto__") == -1 && !Firebug.showOwnProperties)
{
@@ -1111,7 +1106,7 @@ Firebug.DOMBasePanel.prototype = Obj.extend(Firebug.Panel,
else if (object instanceof window.Window || object instanceof StackFrame.StackFrame)
editValue = getRowName(row);
else
- editValue = "this." + getRowName(row);
+ editValue = "this." + getRowName(row); // XXX "this." doesn't actually work
}
Firebug.Editor.startEditing(row, editValue);
--
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