File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -98,15 +98,18 @@ class String : public noncopyable {
9898
9999 static String createExpectingAscii (const char * utf8, size_t len) {
100100 #if WITH_FBJSCEXTENSIONS
101- return String (
102- JSStringCreateWithUTF8CStringExpectAscii (utf8, len), true );
101+ return String (JSStringCreateWithUTF8CStringExpectAscii (utf8, len), true );
103102 #else
104- return String ( JSStringCreateWithUTF8CString (utf8), true );
103+ return createExpectingAscii ( std::string (utf8, len) );
105104 #endif
106105 }
107106
108107 static String createExpectingAscii (std::string const &utf8) {
109- return String::createExpectingAscii (utf8.c_str (), utf8.size ());
108+ #if WITH_FBJSCEXTENSIONS
109+ return createExpectingAscii (utf8.c_str (), utf8.size ());
110+ #else
111+ return String (JSStringCreateWithUTF8CString (utf8.c_str ()), true );
112+ #endif
110113 }
111114
112115 static String ref (JSStringRef string) {
You can’t perform that action at this time.
0 commit comments