[webkit-dev] Asserting versus throwing in internals and testRunner objects

Geoffrey Garen ggaren at apple.com
Fri Sep 23 16:26:45 PDT 2016


I vote for throwing a JS exception.

In my experience, tests that crash are harder to deal with than tests that throw JS exceptions. A backtrace is a less informative than the message “you called internals.X without a frame”. Symbolication takes a long time. And sometimes we have trouble associating crash logs with specific tests.

Geoff

> On Sep 23, 2016, at 2:25 PM, Ryosuke Niwa <rniwa at webkit.org> wrote:
> 
> Hi all,
> 
> In https://bugs.webkit.org/show_bug.cgi?id=161919, a question was
> raised as to what would be the best practice when one of internals or
> testRunner method is called at an undesirable timing or wrong
> arguments.  The case in question was about calling it on a document
> without a frame when the method required a frame.
> 
> What would be the desired outcome of making such a method call?
> Should we be asserting it and crashing the process?  Or should we be
> throwing an exception?
> 
> - R. Niwa
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> https://lists.webkit.org/mailman/listinfo/webkit-dev



More information about the webkit-dev mailing list