Ejemplo n.º 1
0
bool VJSStorageClass::_SetProperty (XBOX::VJSParms_setProperty &ioParms, VJSStorageObject *inStorageObject)
{
	xbox_assert(inStorageObject != NULL);
 
	XBOX::VString	name;

	if (!ioParms.GetPropertyName(name))

		return true;

	if (name.EqualToUSASCIICString("length")) 

		return true;

	sLONG	i;

	for (i = 0; i < kNumberMethods; i++)
	{
		if (name.EqualToUSASCIICString(kMethodNames[i]))

			return true;
	}
	inStorageObject->SetKeyValue(name, ioParms.GetPropertyValue());
	return true;
}
bool VJSXMLHttpRequest::_OnReadyStateChange(XBOX::VJSParms_setProperty& ioParms, XMLHttpRequest* inXhr)
{
    XBOX::VJSObject pReceiver=ioParms.GetObject();
    XBOX::VJSObject pHandler(pReceiver);
    ioParms.GetPropertyValue().GetObject(pHandler, NULL);

    if(pHandler.IsFunction() && inXhr)
    {
        XBOX::VError res=inXhr->OnReadyStateChange(pReceiver, pHandler);

        if(res!=XBOX::VE_OK)
            XBOX::vThrowError(res);
    }
    else
        XBOX::vThrowError(VE_XHRQ_JS_BINDING_ERROR);

    return true;    //todo - mouai, voir ca de plus pres...
}