revert format()'s behavior of crashing on error
Summary:
This reverts
61e20daa, which changed the format code to abort on error.
I do plan to restore the crashing behavior, but I plan to make it
optional. I will add a formatSafe() function that throws on error,
while format() catches these exceptions and crashes.
This diff is an intermediate diff to make it easier to review the
changes. This is close to a straight revert of
61e20daa and
61a41c9b.
However, I did leave the new test case, as well as the
FormatArg::errorStr() method added by those diffs.
Test Plan:
Verified that the existing format tests pass.
Also added a handful of new tests for bad format strings. This did
catch one bug in the code where it wasn't correctly checking for a null
return value from memchr().
Reviewed By: delong.j@fb.com
FB internal diff:
D1144298