Bug 81147 - Typed Array create() methods do not accept const arrays
Summary: Typed Array create() methods do not accept const arrays
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: David Dorwin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-14 13:02 PDT by David Dorwin
Modified: 2012-03-15 16:58 PDT (History)
4 users (show)

See Also:


Attachments
Patch (9.78 KB, patch)
2012-03-14 13:20 PDT, David Dorwin
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Dorwin 2012-03-14 13:02:18 PDT
Many of the Typed Arrays (classes derived from TypedArrayBase) do not allow a pointer to a const array to be passed to the create method. For example:
    static inline PassRefPtr<Uint8Array> create(unsigned char* array, unsigned length);

These methods use
    static PassRefPtr<Subclass> create(const T* array, unsigned length)
so there is no reason the type of the first parameter cannot be const.

The example above should be:
    static inline PassRefPtr<Uint8Array> create(const unsigned char* array, unsigned length);
Comment 1 David Dorwin 2012-03-14 13:20:52 PDT
Created attachment 131908 [details]
Patch
Comment 2 Kenneth Russell 2012-03-14 16:38:02 PDT
Comment on attachment 131908 [details]
Patch

Thanks for fixing this. r=me
Comment 3 WebKit Review Bot 2012-03-15 16:58:49 PDT
Comment on attachment 131908 [details]
Patch

Clearing flags on attachment: 131908

Committed r110913: <http://trac.webkit.org/changeset/110913>
Comment 4 WebKit Review Bot 2012-03-15 16:58:54 PDT
All reviewed patches have been landed.  Closing bug.