mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-05 16:46:26 +00:00
Distinguish between void (VTYPE_VOID) and null (VTYPE_EMPTY). bug 341364, r=bzbarsky sr=shaver
This commit is contained in:
parent
79ae2eb2c9
commit
6cebff1c46
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user