Closed Bug 378571 Opened 18 years ago Closed 18 years ago

extending array prototype makes tree binding fail

Categories

(Toolkit :: UI Widgets, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 318036

People

(Reporter: christian.p, Unassigned)

Details

User-Agent: Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3 Build Identifier: XULRunner 1.8.0.4 hello, I use a JSON library that extends various objects prototypes with the "toJSONString" function. this is the case for Array object. after that, when clicking on a tree columnpicker button, I get an error "element has no properties" file: tree.xml line: 965. here is the code: --snip-- const anonids = ["menuseparator", "menuitem"]; for (var anonid in anonids) { var element = document.getAnonymousElementByAttribute(this, "anonid", anonids[anonid]); element.hidden = hidden; } --snip-- doing a for(var i in array) return prototype extensions too (functions). I correct this in my own code by using array.hasOwnProperty(i) in the loop. Is there a workaround for that? Reproducible: Always Steps to Reproduce: 1. include http://www.json.org/json.js in a XUL window 2. put a tree into into the window with a columnpicker 3. click on the columnpicker button Actual Results: javascript error : element has no properties" file: tree.xml line: 965. Expected Results: columnpicker menu should appear
This is already fixed on the trunk.
Status: UNCONFIRMED → RESOLVED
Closed: 18 years ago
Resolution: --- → DUPLICATE
Hmm, though it should be fixed on the branch too. Which build are you testing? 2.0.0.3 should have the fix...
yes it is already fixed, I misread the 1.8 branch code. I use the 1.8.0 branch (xulrunner) thanks
You need to log in before you can comment on or make changes to this bug.