No wonder it is used this way. Am I the only one who think the name is bad?
It is called 'throw' although it doesn't throw and there is no indication
that it may do nothing.

On Wed, Jun 10, 2009 at 10:35 PM, Adam Barth <[email protected]> wrote:

>
> Maybe it would be worth sweeping through the whole bindings and fixing
> all obvious instances of this.  Otherwise the bad idiom will continue
> to spread like moss.  I'm happy to review the change (either
> @chromium.org or @webkit.org).
>
> Adam
>
>
> On Wed, Jun 10, 2009 at 10:20 AM, Drew Wilson<[email protected]>
> wrote:
> > I've seen quite a few instances of these idioms:
> > 1)
> > if (ec)
> >     throwError(ec);
> >
> > 2)
> > if (ec)
> >     throwError(ec);
> > return v8::Undefined()
> > It's not obvious from the documentation, but throwError() always returns
> > v8::Undefined(), and it does nothing if ec == 0. So the code above could
> be
> > rewritten as:
> > 1)
> > throwError(ec);
> >
> > 2)
> > return throwError(ec);
> > Something to keep in mind/clean up as people work on the bindings -
> there's
> > already a bunch of boilerplate idioms in the binding so every little bit
> > helps :)
> > -atw
> > >
> >
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
Chromium Developers mailing list: [email protected] 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to