W3C home > Mailing lists > Public > public-web-perf@w3.org > July 2011

Re: Open Source Cross-Browser setImmediate in JavaScript

From: Jonas Sicking <jonas@sicking.cc>
Date: Tue, 5 Jul 2011 02:31:21 -0700
Message-ID: <CA+c2ei9ovM7h4ajh23L26Kp9UE5b8nhAgk5x6T8=ACb40m-bag@mail.gmail.com>
To: Donavon West <dwest@book.com>
Cc: public-web-perf@w3.org
On Fri, Jul 1, 2011 at 9:43 PM, Donavon West <dwest@book.com> wrote:
> * please remove the case for a string eval'ed handler argument. Stop the
> madness! Stop it now!


Not only does setImmediate with a string argument come with security
implications (for example for frameworks like Caja, and for policy
languages like CSP), it also encourages people to write less efficient
code, which is contrary to the goals of the setImmediate

I'm also not sure what the use case for being able to cancel callbacks
are? Most likely we'll need to start returning opaque objects rather
than integers (see feedback to the requestAnimationFrame
specification). This means that implementations will have to create an
extra object every time setImmediate is called, even in the likely far
most common use case of the return value being destroyed.

It seems to me that if the use case for setImmediate is to allow
spreading out a calculation over multiple tasks, there isn't much need
to be able to cancel a request.

/ Jonas
Received on Tuesday, 5 July 2011 09:38:14 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:04:31 UTC