Bug 580128 - Fix XPCVariant::VariantDataToJS to properly rewrap, r=gal.

This commit is contained in:
Peter Van der Beken 2010-10-10 15:39:02 -07:00
Родитель 4e1b8c7a56
Коммит 33995dacf8
1 изменённых файлов: 6 добавлений и 3 удалений

Просмотреть файл

@ -425,6 +425,8 @@ XPCVariant::VariantDataToJS(XPCLazyCallContext& lccx,
{
// It's not a JSObject (or it's a JSArray or a JSObject representing an
// nsID). Just pass through the underlying data.
if (!JS_WrapValue(lccx.GetJSContext(), &realVal))
return JS_FALSE;
*pJSVal = realVal;
return JS_TRUE;
}
@ -436,9 +438,10 @@ XPCVariant::VariantDataToJS(XPCLazyCallContext& lccx,
type == nsIDataType::VTYPE_INTERFACE_IS,
"Weird variant");
return XPCWrapper::RewrapObject(lccx.GetJSContext(), scope,
JSVAL_TO_OBJECT(realVal),
XPCWrapper::UNKNOWN, pJSVal);
if (!JS_WrapValue(lccx.GetJSContext(), &realVal))
return JS_FALSE;
*pJSVal = realVal;
return JS_TRUE;
}
// else, it's an object and we really need to double wrap it if we've