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

Re: Support for generators

From: Jonas Sicking <jonas@sicking.cc>
Date: Tue, 6 Nov 2012 23:27:59 -0800
Message-ID: <CA+c2ei9+9ROhSZLAJ+VK1aQTqdRvtp3MhYtvSjBCaytVfMitYQ@mail.gmail.com>
To: David Bruant <bruant.d@gmail.com>
Cc: "public-script-coord@w3.org" <public-script-coord@w3.org>
On Tue, Nov 6, 2012 at 11:35 AM, David Bruant <bruant.d@gmail.com> wrote:
> Hi,
>
> The WebAPI team at Mozilla defined the DeviceStorageAPI [1] which contains
> the following:
> interface DeviceStorage {
>   /* ... */
>  // See interface below for how to use this
>  DeviceStorageCursor enumerate(optional DOMString directory)
>  DeviceStorageCursor enumerateEditable(optional DOMString directory)
> };
>
> interface DeviceStorageCursor : DOMRequest {
>  void continue();
> };
>
> It really feels like an ES6 generator [2]. Is it possible to add a new
> keyword that would allow people defining WebIDL interfaces to define
> generators so that we have consistent interfaces between ES code and web API
> code? For the ECMAScript binding, this keyword would obviously refer to an
> generator.
>
> David
>
> [1] https://wiki.mozilla.org/WebAPI/DeviceStorageAPI
> [2] http://wiki.ecmascript.org/doku.php?id=harmony:generators

Note that the DeviceStorage cursor, just like the IndexedDB cursor, is
completely asynchronous. So it doesn't really map well to ES6
generators or iterators.

For the IndexedDB synchronous API I do agree that we should make it
compatible with ES6 iterators.

/ Jonas
Received on Wednesday, 7 November 2012 07:28:57 UTC

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