The current implementation of JString::value() returns a null string when it fails to resolve its rope in the event of an OutOfMemory error. This can result in null pointer dereferences if callers of the function uses the returned string without checking first for an exception or if the string is null. We can make the code more resilient against such null pointer dereferences by having JSString::value() return an empty string instead of a null string. Callers that previously checked for a null string (as an indication of the OutOfMemory error) can now check for an exception instead. This task will do an audit of all uses of JSString::value() in the project and: 1. make sure that the uses are not dependent on the return string being null, and hence is ok with it returning an empty string. 2. add exception checks where needed.
<rdar://problem/24770483>
Created attachment 271927 [details] work in progress for archiving. Not done yet.