зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1034627 part 5 - Make quick stubs work with Latin1 strings and nursery strings. r=bz
This commit is contained in:
Родитель
42b4bad745
Коммит
bcdc561427
|
@ -422,15 +422,9 @@ xpc_qsDOMString::xpc_qsDOMString(JSContext *cx, HandleValue v,
|
|||
if (!s)
|
||||
return;
|
||||
|
||||
size_t len;
|
||||
const jschar *chars = JS_GetStringCharsZAndLength(cx, s, &len);
|
||||
if (!chars) {
|
||||
mValid = false;
|
||||
return;
|
||||
}
|
||||
nsAutoString *str = new(mBuf) implementation_type();
|
||||
|
||||
new(mBuf) implementation_type(chars, len);
|
||||
mValid = true;
|
||||
mValid = AssignJSString(cx, *str, s);
|
||||
}
|
||||
|
||||
xpc_qsACString::xpc_qsACString(JSContext *cx, HandleValue v,
|
||||
|
@ -471,14 +465,13 @@ xpc_qsAUTF8String::xpc_qsAUTF8String(JSContext *cx, HandleValue v, MutableHandle
|
|||
if (!s)
|
||||
return;
|
||||
|
||||
size_t len;
|
||||
const char16_t *chars = JS_GetStringCharsZAndLength(cx, s, &len);
|
||||
if (!chars) {
|
||||
nsAutoJSString str;
|
||||
if (!str.init(cx, s)) {
|
||||
mValid = false;
|
||||
return;
|
||||
}
|
||||
|
||||
new(mBuf) implementation_type(chars, len);
|
||||
new(mBuf) implementation_type(str);
|
||||
mValid = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -281,7 +281,7 @@ protected:
|
|||
* the string from garbage collection. The caller must leave the jsval alone
|
||||
* for the lifetime of the xpc_qsDOMString.
|
||||
*/
|
||||
class xpc_qsDOMString : public xpc_qsBasicString<nsAString, nsDependentString>
|
||||
class xpc_qsDOMString : public xpc_qsBasicString<nsAString, nsAutoString>
|
||||
{
|
||||
public:
|
||||
xpc_qsDOMString(JSContext *cx, JS::HandleValue v,
|
||||
|
|
Загрузка…
Ссылка в новой задаче