[whatwg] Proposal: createImageBitmap should return a "Promise" instead of using a callback
Rick Waldron
waldron.rick at gmail.com
Thu Jun 20 15:32:43 PDT 2013
On Thu, Jun 20, 2013 at 1:23 PM, Tab Atkins Jr. <jackalmage at gmail.com>wrote:
> On Thu, Jun 20, 2013 at 7:08 AM, Justin Novosad <junov at google.com> wrote:
> > On Wed, Jun 19, 2013 at 10:18 PM, Anne van Kesteren <annevk at annevk.nl
> >wrote:
> >> I think something like
> >>
> >> interface ImageBitmap {
> >> static Promise create(ImageBitmapSource image, optional long sx,
> >> long sy, long sw, long sh);
> >> };
> >>
> >> would be much nicer.
> >
> > I agree it would be nicer, but it seems less consistent with other
> existing
> > APIs.
>
> There's really no consistency here anyway, and the
> "Interface.create()" idiom is pretty easy and nice.
>
> I wonder - perhaps we can call the function "new"? Dunno which name is
> better.
>
Can I ask that you steer clear of that? There has been discussion of
possibly providing static .new() on built-ins that produce instances
without new operator. I dont know where that stands, but of course it
wouldn't be revisited until ES7. It would be nice if that wasn't DOA due to
web-breakage.
Thanks.
Rick
>
> ~TJ
>
More information about the whatwg
mailing list