Distinguish between void (VTYPE_VOID) and null (VTYPE_EMPTY). bug 341364, r=bzbarsky sr=shaver

This commit is contained in:
mrbkap%gmail.com 2006-06-14 16:41:29 +00:00
parent 79ae2eb2c9
commit 6cebff1c46

View File

@ -249,7 +249,7 @@ JSBool XPCVariant::InitializeData(XPCCallContext& ccx)
return NS_SUCCEEDED(nsVariant::SetFromBool(&mData,
JSVAL_TO_BOOLEAN(mJSVal)));
if(JSVAL_IS_VOID(mJSVal))
return NS_SUCCEEDED(nsVariant::SetToEmpty(&mData));
return NS_SUCCEEDED(nsVariant::SetToVoid(&mData));
if(JSVAL_IS_NULL(mJSVal))
return NS_SUCCEEDED(nsVariant::SetToEmpty(&mData));
if(JSVAL_IS_STRING(mJSVal))
@ -564,9 +564,11 @@ VARIANT_DONE:
return JS_TRUE;
}
case nsIDataType::VTYPE_VOID:
case nsIDataType::VTYPE_EMPTY:
*pJSVal = JSVAL_VOID;
return JS_TRUE;
case nsIDataType::VTYPE_EMPTY:
*pJSVal = JSVAL_NULL;
return JS_TRUE;
default:
NS_ERROR("bad type in variant!");
return JS_FALSE;