W3C home > Mailing lists > Public > public-html@w3.org > September 2007

Re: 2.3.2. DOMTokenList

From: Marek Pawlowski <marekp.w3c@gmail.com>
Date: Wed, 5 Sep 2007 22:42:45 +0200
Message-ID: <cc36d2760709051342j549b2347i2c63fa032091b0e1@mail.gmail.com>
To: "Ian Hickson" <ian@hixie.ch>
Cc: public-html@w3.org
On 2007/9/5, Ian Hickson <ian@hixie.ch> wrote:
> Wouldn't:
>    with (myDiv.classList) {
>      add('toFront');
>      toggle('maximized');
>    }
> ...be the better way to do this? In general the DOM doesn't do
> chaining-style APIs, so I'm reluctant to add it here.
As far as I remember, use of  "with" statement is discouraged due to
performance problems in existing implementations.
Anyway there is good use case for function chaining in current
Javascript frameworks like jQuery and IIRC prototype.js with some
extensions. But it's just came to my mind; I wont zealously fight for
this :)

Marek Pawłowski
Received on Wednesday, 5 September 2007 20:42:51 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:16:07 GMT