зеркало из https://github.com/mozilla/gecko-dev.git
Bug 580128 - Fix XPCVariant::VariantDataToJS to properly rewrap, r=gal.
This commit is contained in:
Родитель
4e1b8c7a56
Коммит
33995dacf8
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче