Closed Bug 221995 Opened 21 years ago Closed 18 years ago

Coding error in jsObject.js

Categories

(Other Applications :: DOM Inspector, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: neil, Assigned: neil)

References

Details

Attachments

(2 files, 1 obsolete file)

 
Attached patch Proposed patch (obsolete) — Splinter Review
So, was kids supposed to be a node or a node list?
Comment on attachment 133189 [details] [diff] [review]
Proposed patch

>   openTreeItem: function(aItem)
>   {
>-    var kids = aItem.getElementsByTagName("treechildren");
>-    if (kids.length == 0) {
>-      kids = document.createElement("treechildren");
>+    var treechildren = aItem.getElementsByTagName("treechildren").item(0);
>+    if (!treechildren) {
>+      treechildren = document.createElement("treechildren");

A rose by any other name... the intent of the kids argument is pretty clear
here, I think.

>       aItem.appendChild(kids);

And if you really want this, this argument needs to change too, or you get an
instant strict JS warning and a regression, at the very least.

>     }
>     
>-    this.buildPropertyTree(kids, aItem.__JSValue__);
>+    this.buildPropertyTree(treechildren, aItem.__JSValue__);

Ditto on the rose.

>   },
>   
>   onCreateContext: function(aPopup)
>@@ -276,7 +276,7 @@ function getSelectedItem()
> {
>   var tree = document.getElementById("treeJSObject");
>   if (tree.view.selection.count)
>-    return tree.contentView.getItemAtIndex(tree.curentIndex);
>+    return tree.view.getItemAtIndex(tree.curentIndex);

tree.currentIndex

Finally, I'm working on revising my patch to bug 193942, where half of the
jsObject.js file is rewritten.	The openTreeItem() function will be obsoleted
and removed by my patch.  (I know it's taking me forever, but I think you
should consider the revisions.)
As you noticed I attached the wrong diff...

Anyway IMHO "kids" is an inappropriate name for an element.
Product: Core → Other Applications
*** Bug 317322 has been marked as a duplicate of this bug. ***
Attached patch Corrected patchSplinter Review
Assignee: dom-inspector → neil.parkwaycc.co.uk
Attachment #133189 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #203931 - Flags: review?(timeless)
Attachment #203931 - Flags: review?(timeless) → review+
Comment on attachment 203931 [details] [diff] [review]
Corrected patch

Given as there's no moa? flag in bugzilla...
Attachment #203931 - Flags: review?(caillon)
Attachment #203931 - Flags: review?(caillon) → review+
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Oops, fix is wrong, coding error hid logic error.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attached patch Logic fixSplinter Review
Attachment #223165 - Flags: review?(timeless)
Attachment #223165 - Flags: review?(timeless) → review+
Fix for logic error hidden by coding error checked in.
Status: REOPENED → RESOLVED
Closed: 18 years ago18 years ago
Resolution: --- → FIXED
QA Contact: timeless → dom-inspector
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: