JavaScriptCore should build with newer clang
<http://webkit.org/b/136002>
<rdar://problem/18020616>
Reviewed by Geoffrey Garen.
Source/JavaScriptCore:
Other than the JSC::SourceProvider::asID() change (which simply
removes code that the optimizing compiler would have discarded
in Release builds), we move the |this| checks in OpaqueJSString
to NULL checks in to JSBase, JSScriptRef, JSStringRef{CF} and
JSValueRef.
(JSEvaluateScript): Use String() in case |script| or |sourceURL|
are NULL.
(JSScriptCreateReferencingImmortalASCIIText): Use String() in
case |url| is NULL.
(JSStringGetLength): Return early if NULL pointer is passed in.
(JSStringGetCharactersPtr): Ditto.
(JSStringGetUTF8CString): Ditto. Also check |buffer| parameter.
(JSStringCopyCFString): Ditto.
(JSValueMakeString): Use String() in case |string| is NULL.
(OpaqueJSString::string): Remove code that checks |this|.
(OpaqueJSString::identifier): Ditto.
(OpaqueJSString::characters): Ditto.
(OpaqueJSString::is8Bit): Remove code that checks |this|.
(OpaqueJSString::characters8): Ditto.
(OpaqueJSString::characters16): Ditto.
(OpaqueJSString::length): Ditto.
(JSC::SourceProvider::asID): Remove code that checks |this|.
Source/WebKit2:
- Shared/API/c/WKString.cpp:
(WKStringCreateWithJSString): Add NULL check to prevent
WebKitTestRunner crashes that relied on the previous |this|
behavior where NULL values were allowed.