mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
Bug 934817 - Part 2: Remove 0-length check in XPCStringConvert::ReadableToJSVal and XPCConvert::NativeData2JS. r=bz
This commit is contained in:
parent
a094223027
commit
c0179b2588
@ -291,11 +291,6 @@ XPCConvert::NativeData2JS(MutableHandleValue d, const void* s,
|
||||
if (!cString || cString->IsVoid())
|
||||
break;
|
||||
|
||||
if (cString->IsEmpty()) {
|
||||
d.set(JS_GetEmptyStringValue(cx));
|
||||
break;
|
||||
}
|
||||
|
||||
// c-strings (binary blobs) are deliberately not converted from
|
||||
// UTF-8 to UTF-16. T_UTF8Sting is for UTF-8 encoded strings
|
||||
// with automatic conversion.
|
||||
|
@ -78,10 +78,6 @@ XPCStringConvert::ReadableToJSVal(JSContext *cx,
|
||||
*sharedBuffer = nullptr;
|
||||
|
||||
uint32_t length = readable.Length();
|
||||
if (length == 0) {
|
||||
vp.set(JS_GetEmptyStringValue(cx));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (readable.IsLiteral()) {
|
||||
JSString *str = JS_NewExternalString(cx,
|
||||
|
Loading…
Reference in New Issue
Block a user