W3C home > Mailing lists > Public > public-script-coord@w3.org > July to September 2013

[Bug 22391] Sequence or Array

From: <bugzilla@jessica.w3.org>
Date: Wed, 10 Jul 2013 20:29:10 +0000
To: public-script-coord@w3.org
Message-ID: <bug-22391-3890-cenp0H2ToF@http.www.w3.org/Bugs/Public/>

--- Comment #9 from Boris Zbarsky <bzbarsky@mit.edu> ---
Domenic, I'm not sure what you mean by "non-frozen, snapshot".

Fundamentally, there are several kinds of APIs:

1)  API that just returns a new array each time.  These should return a
    (which means just a normal writable JS Array) and should be methods, not
    property getters.
2)  API that keeps returning the same array object as long as its contents do
    change.  This can be a method, of course (returning a frozen JS Array, say,
    so that one caller can't mess up what other callers see).  Can it be a
    property getter?  It seems like this is an OK thing to do, actually, since
    the new object would only appear when the list being represented has in
3)  APIs that return some sort of live arraylike collection.  The problem here
    that in most cases the liveness means that the DOM implementation needs to
    able to write into the array but callers need to not be able to do so. 
    that means is that the script-visible behavior is basically some sort of
    proxy around an Array.

As I said in comment 4, there has been a general movement away from case 3 in
API design.  Case 1 is non-controversial.  So the main interesting thing is
case 2.

You are receiving this mail because:
You are on the CC list for the bug.
Received on Wednesday, 10 July 2013 20:29:12 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:17 UTC