[Webkit-unassigned] [Bug 36545] [Chromium] Add an ASSERT macro to the Chromium WebKit API

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Mar 25 03:35:53 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=36545





--- Comment #3 from Jeremy Orlow <jorlow at chromium.org>  2010-03-25 03:35:53 PST ---
> > +// Only use inside the public directory but outside of WEBKIT_IMPLEMENTATION blocks.  Otherwise use WTF's ASSERT.
> 
> There is actually no problem using this outside of WEBKIT_IMPLEMENTATION
> blocks.

I know, but the WebCore asserts are more robust and have extra logic for
turning them on/off.  Just seemed like a good idea to point people in that
direction primarily.

> > +#if defined(NDEBUG)
> > +#define WEBKIT_ASSERT(assertion) ((void)0)
> > +#else
> > +#define WEBKIT_ASSERT(assertion) do \
> > +    if (!(assertion)) { \
> > +        WebKit::failedAssertion(__FILE__, __LINE__, __FUNCTION__, #assertion); \
> > +    } \
> 
> ^^^ nit: webkit style says no brackets around single line statements.

Just copied what was in Assertions (and then removed a line).  I suppose
brackets should be around the do/while tho.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list