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<atwil...@chromium.org> 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: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to