W3C home > Mailing lists > Public > public-script-coord@w3.org > October to December 2012

Re: [WebIDL] Would it make sense to add annotations for "creates a new object each time" and "always returns the same object"?

From: Ojan Vafai <ojan@chromium.org>
Date: Mon, 22 Oct 2012 22:33:19 -0700
Message-ID: <CANMdWTuyWfy5D01=LavFXmfRn_F5nmok-SxRe5VKnKXuxZTR6g@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: Glenn Adams <glenn@skynav.com>, "public-script-coord@w3.org" <public-script-coord@w3.org>
On Mon, Oct 22, 2012 at 8:08 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:

> 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?

Good point. That would be silly.
Received on Tuesday, 23 October 2012 05:34:09 UTC

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