Closed Bug 664184 Opened 13 years ago Closed 13 years ago

Mistakes in JavaScript Object viewer implementation

Categories

(Other Applications :: DOM Inspector, defect)

defect
Not set
trivial

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: crussell, Assigned: crussell)

Details

Attachments

(1 file)

When fixing but 193942, I noticed three things in the new jsObject tree view:

1.  isContainerEmpty begins as follows:

>   if (!this.isContainer(aIndex)) {
>     return true;
>   }

This should, of course, return false.  This has the effect that after the subject setter calls toggleOpenState, if the subject is a string, the row is expanded to show the string's indexes.

2. JSOV_ToggleOpenState doesn't need to call checkForBadIndex.  JSOV_IsContainerEmpty will call isContainer, which will in turn call checkForBadIndex, and if you follow along as the stack then unwinds, you'll notice that it ends up doing the Right Thing.

3. When comparing JSOV_IsContainer to InspectInNewWindowBase_IsInspectable, I noticed that the former doesn't handle null correctly.  In fact, baseCommands.js is already in use, so after we check for a bad index, we can just return the result of a call to the latter.
(In reply to comment #0)
> 1.  isContainerEmpty begins as follows:
> 
> >   if (!this.isContainer(aIndex)) {
> >     return true;
> >   }
> 
> This should, of course, return false.

Er, the other way around, I mean.  false is what it returns now, true is what it should return.
Attachment #539526 - Flags: review?(neil)
Attachment #539526 - Flags: review?(neil) → review+
Pushed: http://hg.mozilla.org/dom-inspector/rev/697016a1e944
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: