Re: Guidance on using sequences and arrays

On 6/26/13 11:23 AM, Domenic Denicola wrote:
> This is actually a really important point. `getCalls()` returning a fresh, but mutable, array seems much more reasonable than a `calls` property that (a) cannot be messed with by script; (b) changes out from under you due to C++ magic. Unfortunately that does kill any hopes of using `Object.observe` since there's no single object you can observe.
>
> I think if you contemplated how to implement this in JavaScript there's not much else that would make sense. (Could be wrong, though!)

Well, both are implementable in JS.  .calls can return a proxy for an 
array that allows reads but not writes, etc...

Not many libraries today would implement it that way, not least because 
proxy support in UAs is spotty.  But if it were not spotty, I'm not sure 
what people would do.

My gut feel is that a getCalls() that returns a new object, but this is 
me trying to think like a JS programmer, which is a nontrivial exercise.

-Boris

Received on Wednesday, 26 June 2013 15:31:57 UTC