Bug 53618 - Rename Typed Array subset to subarray
Summary: Rename Typed Array subset to subarray
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Kenneth Russell
URL:
Keywords:
Depends on: 53273
Blocks:
  Show dependency treegraph
 
Reported: 2011-02-02 12:32 PST by Kenneth Russell
Modified: 2011-02-03 12:09 PST (History)
6 users (show)

See Also:


Attachments
Patch (49.87 KB, patch)
2011-02-02 13:22 PST, Kenneth Russell
jamesr: review+
kbr: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kenneth Russell 2011-02-02 12:32:56 PST
After discussion with Mozilla about the recent renaming of the Typed Array classes' slice method to subset, they strongly preferred the name "subarray" and we agreed to change the name to that. Need to once again update the WebKit implementation; this will be the last such renaming.
Comment 1 Kenneth Russell 2011-02-02 13:22:35 PST
Created attachment 80957 [details]
Patch
Comment 2 Kenneth Russell 2011-02-02 13:37:19 PST
Committed r77412: <http://trac.webkit.org/changeset/77412>
Comment 3 WebKit Review Bot 2011-02-02 15:47:03 PST
http://trac.webkit.org/changeset/77412 might have broken GTK Linux 32-bit Release
The following tests are not passing:
editing/selection/find-yensign-and-backslash.html
http/tests/websocket/tests/handshake-fail-by-sub-protocol-mismatch.html
Comment 4 Chris Marrin 2011-02-02 17:35:08 PST
(In reply to comment #0)
> After discussion with Mozilla about the recent renaming of the Typed Array classes' slice method to subset, they strongly preferred the name "subarray" and we agreed to change the name to that. Need to once again update the WebKit implementation; this will be the last such renaming.

When was this decided? I don't see any traffic in the WebGL list about this. Is there some list where Typed Array is being discussed that I have not seen? 

I think the name subarray is no more clear than subset, especially given that it's not a word that appears in the dictionary. It would be much better if we could discuss this before committing the change. 

I'm not even sure the concept of creating a view that is the subset of another view into the same ArrayBuffer is needed. A "subarray" function could be written in JavaScript, since each Typed Array exposes its buffer, byteOffset and byteLength. And with BYTES_PER_ELEMENT you could write one such function that worked for all types.

A more useful function might be one that can actually slice out a part of an ArrayBuffer into a new Typed Array backed by a new ArrayBuffer. But doing such a thing would need to be able to do a scatter/gather operation on interleaved arrays to be really useful. And since I don't think we're prepared to do anything that major at this point, I think it would be better to just avoid any functions like this for this release.
Comment 5 Kenneth Russell 2011-02-03 12:09:06 PST
(In reply to comment #4)
> When was this decided? I don't see any traffic in the WebGL list about this. Is there some list where Typed Array is being discussed that I have not seen? 

Apologies -- this discussion happened in a hurry on the Mozilla bug where they were renaming slice() to subset(): https://bugzilla.mozilla.org/show_bug.cgi?id=630117 . The TC39 members' arguments to using a different name than subset() seemed reasonable, and since we'd just gone through one renaming it seemed like we should quickly rename it to something that everyone was reasonably happy with. Both the Typed Array spec editors (Vlad and me) were in agreement.

You and I've discussed this in more depth on the WebGL conference call today, and Vlad already apologized to all developers on the public WebGL list, so hopefully we can lay this one to rest and move on to other work :)