Last Comment Bug 344669 - mozilla array guide uses deprecated function NS_NewArray
: mozilla array guide uses deprecated function NS_NewArray
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: XPCOM (show other bugs)
: Trunk
: x86 Windows XP
: -- normal (vote)
: ---
Assigned To: Benjamin Smedberg [:bsmedberg]
:
Mentors:
http://www.mozilla.org/projects/xpcom...
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-07-14 05:53 PDT by Stig Sandø
Modified: 2007-02-22 07:40 PST (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description Stig Sandø 2006-07-14 05:53:48 PDT
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4

The function NS_NewArray was removed from the SDK but is still used in the Mozilla Array Guide.  The removal from the code:
http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&root=/cvsroot&subdir=/mozilla/xpcom/ds&command=DIFF_FRAMESET&file=nsArray.h&rev2=1.12&rev1=1.11

Mozilla Array guide:
http://www.mozilla.org/projects/xpcom/array-guide.html



Reproducible: Always




The sample code that uses NS_NewArray:
void GetList(nsIArray** aResult) {
        nsCOMPtr<nsIMutableArray> array;
        NS_NewArray(getter_AddRefs(array));

        // append some elements
        ...

        // return it to the caller
        *aResult = array;
        NS_ADDREF(*aResult);
    }
Comment 1 Wan-Teh Chang 2006-07-14 10:08:20 PDT
Boris, this is a documentation bug in the
"Guide to the Mozilla Array Classes" that you
and Alec Flett wrote.
Comment 2 Boris Zbarsky [:bz] (Out June 25-July 6) 2006-07-16 09:26:31 PDT
I didn't write most of this guide, actually.  I just did that last "Which Array should I use?" section.

More to the point, I have no idea what the docs should say now.  Benjamin, mind updating the docs to reflect the new world?
Comment 3 Benjamin Smedberg [:bsmedberg] 2007-02-22 07:40:56 PST
Fixed on MDC.

Note You need to log in before you can comment on or make changes to this bug.