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

ECMAScript and chaining

From: Anne van Kesteren <annevk@annevk.nl>
Date: Wed, 21 Nov 2012 23:26:36 +0100
Message-ID: <CADnb78i=WiWx26yBfCYbWgYzk3HaFXX2FqJFvcMK5vMG793duQ@mail.gmail.com>
To: public-script-coord@w3.org
Hi,

I was wondering if the plan of TC39 is to start returning the object
on which a method was invoked if that method would otherwise just
return undefined. E.g. this seems to be what Object.freeze() and
Object.preventExtensions() do. It's also a somewhat popular API idiom
in jQuery and the like (see also method chaining, fluent interface).

(The reason I'm asking is that I just WONTFIXED two bugs asking for
that stating that ECMAScript did not have this pattern either and I
was confronted with the above. I had been looking at Map.set()
myself.)

Cheers,


-- 
http://annevankesteren.nl/
Received on Wednesday, 21 November 2012 22:27:04 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:08 UTC