Bug 864727 part 3. Pass a handle for the parent object to WebIDL dictionary ToObject. r=ms2ger

This commit is contained in:
Boris Zbarsky 2013-04-25 12:29:53 -04:00
parent 2c5ce6945c
commit 1b68038a46
3 changed files with 8 additions and 8 deletions

View File

@ -3614,7 +3614,7 @@ if (%s.IsNull()) {
innerTemplate = CGIndenter(CGGeneric(innerTemplate), 6).define()
return (("""
uint32_t length = %s.Length();
JSObject *returnArray = JS_NewArrayObject(cx, length, NULL);
JS::Rooted<JSObject*> returnArray(cx, JS_NewArrayObject(cx, length, nullptr));
if (!returnArray) {
%s
}
@ -7068,7 +7068,7 @@ class CGDictionary(CGThing):
"struct ${selfName} ${inheritance}{\n"
" ${selfName}() {}\n"
" bool Init(JSContext* cx, const JS::Value& val);\n"
" bool ToObject(JSContext* cx, JSObject* parentObject, JS::Value *vp);\n"
" bool ToObject(JSContext* cx, JS::Handle<JSObject*> parentObject, JS::Value *vp);\n"
"\n" +
(" bool Init(const nsAString& aJSON)\n"
" {\n"
@ -7173,7 +7173,7 @@ class CGDictionary(CGThing):
"}\n"
"\n"
"bool\n"
"${selfName}::ToObject(JSContext* cx, JSObject* parentObject, JS::Value *vp)\n"
"${selfName}::ToObject(JSContext* cx, JS::Handle<JSObject*> parentObject, JS::Value *vp)\n"
"{\n" +
# NOTE: jsids are per-runtime, so don't use them in workers
(" if (!initedIds && !InitIds(cx)) {\n"

View File

@ -434,7 +434,7 @@ inDOMUtils::ColorNameToRGB(const nsAString& aColorName, JSContext* aCx,
triple.mG = NS_GET_G(color);
triple.mB = NS_GET_B(color);
if (!triple.ToObject(aCx, nullptr, aValue)) {
if (!triple.ToObject(aCx, JS::NullPtr(), aValue)) {
return NS_ERROR_FAILURE;
}

View File

@ -91,7 +91,7 @@ Dashboard::GetSockets()
}
JS::Value val;
if (!dict.ToObject(cx, nullptr, &val)) {
if (!dict.ToObject(cx, JS::NullPtr(), &val)) {
mSock.cb = nullptr;
mSock.data.Clear();
return NS_ERROR_FAILURE;
@ -198,7 +198,7 @@ Dashboard::GetHttpConnections()
}
JS::Value val;
if (!dict.ToObject(cx, nullptr, &val)) {
if (!dict.ToObject(cx, JS::NullPtr(), &val)) {
mHttp.cb = nullptr;
mHttp.data.Clear();
return NS_ERROR_FAILURE;
@ -338,7 +338,7 @@ Dashboard::GetWebSocketConnections()
}
JS::Value val;
if (!dict.ToObject(cx, nullptr, &val)) {
if (!dict.ToObject(cx, JS::NullPtr(), &val)) {
mWs.cb = nullptr;
mWs.data.Clear();
return NS_ERROR_FAILURE;
@ -427,7 +427,7 @@ Dashboard::GetDNSCacheEntries()
}
JS::Value val;
if (!dict.ToObject(cx, nullptr, &val)) {
if (!dict.ToObject(cx, JS::NullPtr(), &val)) {
mDns.cb = nullptr;
mDns.data.Clear();
return NS_ERROR_FAILURE;