The various flavors of WebFrame::_stringByEvaluatingJavaScriptFromString don't properly handle nil string. Instead such nil strings are passed down to the JavaScript engine where it may be a crash. An if (!string) return @"": should be added as appropriate.
Created attachment 145346 [details] Patch
Comment on attachment 145346 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=145346&action=review > Tools/TestWebKitAPI/Tests/mac/StringByEvaluatingJavaScriptFromString.mm:60 > + EXPECT_EQ(nil, result); Don't you expect an empty string, not a nil string?
Comment on attachment 145346 [details] Patch Expectation should be empty string. Does nil pass?
Created attachment 145369 [details] Patch with fix (In reply to comment #3) > (From update of attachment 145346 [details]) > Expectation should be empty string. Does nil pass? I was thinking about this as I was out at lunch, realizing that the test was wrong. The test was "passing", but shouldn't. I was assuming that run-test-webkit-api built the tests before running. Therefore I wasn't testing the new code. Built and tested this patch. It works as expected.
Comment on attachment 145369 [details] Patch with fix r=me
Committed r119280: <http://trac.webkit.org/changeset/119280>
<rdar://problem/11620927>