Closed Bug 1290771 Opened 8 years ago Closed 8 years ago

Array.prototype methods are also listed in the left nav

Categories

(Developer Documentation Graveyard :: JavaScript, defect, P5)

All
Other
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gilbertson.david, Assigned: arai)

References

()

Details

:: Developer Documentation Request

      Request Type: Correction
     Gecko Version: Trunk
 Technical Contact: 

:: Details

The navigation tree on the left of the page should list just the global objects, ending in "undefined", "unescape()", "uneval()".

But the list goes on to list "Array.from()", "Array.isArray()" etc.
https://developer.mozilla.org/en-US/docs/Template:ListSubpagesForSidebar
> var pages = page.subpagesExpand(path, -1, parent);
> ...
> if (pages.length) {
>     output += openTag;
> 
>     pages.forEach(function(item) {
>         if (!item) { return; }
>         output += createLink(item);
>     });
> 
>     if (pages[0].subpages.length > 0) {
>       pages[0].subpages.forEach(function(item) {
>         if (!item) { return; }
>         output += createLink(item);
>       });
>     }
> 
>     output += closeTag;
> }

There it iterates over the first subpage's subpages.

and the first subpage of Global_Objects is Global_Objects/Array.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects$children

fscholz, what's the reason for iterating over the first subpage's subpages?
Flags: needinfo?(fscholz)
(In reply to Tooru Fujisawa [:arai] from comment #1)
> fscholz, what's the reason for iterating over the first subpage's subpages?

I can't remember, which is unfortunate. It doesn't make sense to have that there. We should be able to use ListSubpagesForSidebar as a more generic function without these special cases.

I guess we can remove that bit and maybe at some point we will find out where I had used this case :D
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(fscholz)
Removed the code to iterate over first subpage's subpages
  https://developer.mozilla.org/en-US/docs/Template:ListSubpagesForSidebar
and updated the page
  https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects
and I don't see any issue in several pages linked from there
Assignee: nobody → arai.unmht
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.