- From: Boris Zbarsky <bzbarsky@MIT.EDU>
- Date: Mon, 22 Oct 2012 23:08:47 -0400
- To: Ojan Vafai <ojan@google.com>
- CC: Glenn Adams <glenn@skynav.com>, "public-script-coord@w3.org" <public-script-coord@w3.org>
On 10/22/12 9:24 PM, Ojan Vafai wrote: > Obviously, there's nothing we can do about legacy APIs, so it might > still make sense to add the annotation even if we decide that methods > should always return a new object. Having methods always return a new object is silly, imo. Consider a method like getElementById. How would it make any sense for it to always return a new object? The whole problem with methods is that whether they return new objects or existing objects needs to be carefully considered when defining the method. It's obvious in some cases (getElementById, createElement), but not at all in others.... -Boris
Received on Tuesday, 23 October 2012 03:09:16 UTC