[webkit-reviews] review granted: [Bug 35048] an 'undefined' return value from a statement error callback should be treated as 'true' : [Attachment 48953] patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Feb 18 10:51:43 PST 2010


Darin Adler <darin at apple.com> has granted Dumitru Daniliuc
<dumi at chromium.org>'s request for review:
Bug 35048: an 'undefined' return value from a statement error callback should
be treated as 'true'
https://bugs.webkit.org/show_bug.cgi?id=35048

Attachment 48953: patch
https://bugs.webkit.org/attachment.cgi?id=48953&action=review

------- Additional Comments from Darin Adler <darin at apple.com>
> -    return result.toBoolean(exec);
> +    return !result.isBoolean() || result.toBoolean(exec);

While this will work, it's unnecessarily inefficient. The toBoolean function's
job is to convert things from other types to boolean. The efficient way is to
write:

    return result.isFalse();

The patch otherwise seems fine. r=me, but please make the fix I suggest above.


More information about the webkit-reviews mailing list