Skip to content

Commit e6fc375

Browse files
committed
JSStringCreateWithCFString should not convert the empty string into the NULL string
https://bugs.webkit.org/show_bug.cgi?id=118816 Reviewed by Sam Weinig. * API/JSStringRef.cpp: (JSStringCreateWithUTF8CString): Removed an extraneous comment, which a previous version of the patch made incorrect. * API/JSStringRefCF.cpp: (JSStringCreateWithCFString): Don't convert the empty string into the null string. Canonical link: https://commits.webkit.org/136681@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@152807 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent e796697 commit e6fc375

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

‎Source/JavaScriptCore/API/JSStringRef.cpp‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ JSStringRef JSStringCreateWithUTF8CString(const char* string)
5656
}
5757
}
5858

59-
// Null string.
6059
return OpaqueJSString::create().leakRef();
6160
}
6261

‎Source/JavaScriptCore/API/JSStringRefCF.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ JSStringRef JSStringCreateWithCFString(CFStringRef string)
5353
return OpaqueJSString::create(reinterpret_cast<UChar*>(buffer.get()), length).leakRef();
5454
}
5555

56-
return OpaqueJSString::create(static_cast<const LChar*>(0), 0).leakRef();
56+
return OpaqueJSString::create(reinterpret_cast<const LChar*>(""), 0).leakRef();
5757
}
5858

5959
CFStringRef JSStringCopyCFString(CFAllocatorRef alloc, JSStringRef string)

‎Source/JavaScriptCore/ChangeLog‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
2013-07-17 Geoffrey Garen <ggaren@apple.com>
2+
3+
JSStringCreateWithCFString should not convert the empty string into the NULL string
4+
https://bugs.webkit.org/show_bug.cgi?id=118816
5+
6+
Reviewed by Sam Weinig.
7+
8+
* API/JSStringRef.cpp:
9+
(JSStringCreateWithUTF8CString): Removed an extraneous comment, which
10+
a previous version of the patch made incorrect.
11+
12+
* API/JSStringRefCF.cpp:
13+
(JSStringCreateWithCFString): Don't convert the empty string into the
14+
null string.
15+
116
2013-07-17 Chris Curtis <chris_curtis@apple.com>
217

318
Naming convention on createInvalidParamError is incorrect.

0 commit comments

Comments
 (0)