Backed out changeset 8f50bc05d337 (bug 1034627) for debug build failures

This commit is contained in:
Ed Morley 2014-07-11 15:46:53 +01:00
parent d6d6dd55ba
commit 9d72dd53ad
2 changed files with 13 additions and 6 deletions

View File

@ -422,9 +422,15 @@ xpc_qsDOMString::xpc_qsDOMString(JSContext *cx, HandleValue v,
if (!s)
return;
nsAutoString *str = new(mBuf) implementation_type();
size_t len;
const jschar *chars = JS_GetStringCharsZAndLength(cx, s, &len);
if (!chars) {
mValid = false;
return;
}
mValid = AssignJSString(cx, *str, s);
new(mBuf) implementation_type(chars, len);
mValid = true;
}
xpc_qsACString::xpc_qsACString(JSContext *cx, HandleValue v,
@ -465,13 +471,14 @@ xpc_qsAUTF8String::xpc_qsAUTF8String(JSContext *cx, HandleValue v, MutableHandle
if (!s)
return;
nsAutoJSString str;
if (!str.init(cx, s)) {
size_t len;
const char16_t *chars = JS_GetStringCharsZAndLength(cx, s, &len);
if (!chars) {
mValid = false;
return;
}
new(mBuf) implementation_type(str);
new(mBuf) implementation_type(chars, len);
mValid = true;
}

View File

@ -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, nsAutoString>
class xpc_qsDOMString : public xpc_qsBasicString<nsAString, nsDependentString>
{
public:
xpc_qsDOMString(JSContext *cx, JS::HandleValue v,