diff options
Diffstat (limited to 'src/standards/Tizen/Messaging/JSMessagingStorage.cpp')
-rwxr-xr-x | src/standards/Tizen/Messaging/JSMessagingStorage.cpp | 46 |
1 files changed, 15 insertions, 31 deletions
diff --git a/src/standards/Tizen/Messaging/JSMessagingStorage.cpp b/src/standards/Tizen/Messaging/JSMessagingStorage.cpp index 726186c..5f101f3 100755 --- a/src/standards/Tizen/Messaging/JSMessagingStorage.cpp +++ b/src/standards/Tizen/Messaging/JSMessagingStorage.cpp @@ -397,7 +397,7 @@ namespace Tizen1_0 { else // NOT nullable { LogDebug("Filter type is mismatched."); - Throw(ConversionException); + Throw(ConversionException); } } if(argumentCount >= 2) // successCallback @@ -421,7 +421,7 @@ namespace Tizen1_0 { else if(!Validator(context).isNullOrUndefined(arguments[2])) //nullable { LogDebug("ErrorCallback type is mismatched."); - Throw(ConversionException); + Throw(ConversionException); } } if(argumentCount >= 4) //optional SortMode? sortMode @@ -436,32 +436,24 @@ namespace Tizen1_0 { LogDebug("SortMode type is mismatched."); Throw(ConversionException); } - } + } if(argumentCount >= 5) //optional unsigned long? limit JSValueIsUndefined(context, arguments[0]), JSValueIsNull(context, arguments[0]) { if (!Validator(context).isNullOrUndefined(arguments[4])) { - if (!JSValueIsNumber(context, arguments[4])) - { - Throw(ConversionException); - } long limit = filterConverter->toULong(arguments[4]); event->setLimit(limit); - } - } + } + } if(argumentCount >= 6) //optional unsigned long? offset JSValueIsUndefined(context, arguments[0]), JSValueIsNull(context, arguments[0]) { if (!Validator(context).isNullOrUndefined(arguments[5])) { - if (!JSValueIsNumber(context, arguments[5])) - { - Throw(ConversionException); - } long offset = filterConverter->toULong(arguments[5]); event->setOffset(offset); } - } - + } + if(callbackManager) { callbackManager->setOnSuccess(onSuccessForCbm); @@ -907,7 +899,7 @@ namespace Tizen1_0 { else // NOT nullable { LogDebug("Filter type is mismatched."); - Throw(ConversionException); + Throw(ConversionException); } } if(argumentCount >= 2) // successCallback @@ -923,7 +915,7 @@ namespace Tizen1_0 { } } if(argumentCount >= 3) //optional ErrorCallback? errorCallback - { + { if(Validator(context).isCallback(arguments[2])) { onErrorForCbm = arguments[2]; @@ -931,7 +923,7 @@ namespace Tizen1_0 { else if(!Validator(context).isNullOrUndefined(arguments[2])) //nullable { LogDebug("ErrorCallback type is mismatched."); - Throw(ConversionException); + Throw(ConversionException); } } if(argumentCount >= 4) //optional SortMode? sortMode @@ -946,29 +938,21 @@ namespace Tizen1_0 { LogDebug("SortMode type is mismatched."); Throw(ConversionException); } - } + } if(argumentCount >= 5) //optional unsigned long? limit JSValueIsUndefined(context, arguments[0]), JSValueIsNull(context, arguments[0]) { if (!Validator(context).isNullOrUndefined(arguments[4])) { - if (!JSValueIsNumber(context, arguments[4])) - { - Throw(ConversionException); - } long limit = filterConverter->toULong(arguments[4]); event->setLimit(limit); - } - } + } + } if(argumentCount >= 6) //optional unsigned long? offset JSValueIsUndefined(context, arguments[0]), JSValueIsNull(context, arguments[0]) { if (!Validator(context).isNullOrUndefined(arguments[5])) { - if (!JSValueIsNumber(context, arguments[5])) - { - Throw(ConversionException); - } long offset = filterConverter->toULong(arguments[5]); - event->setOffset(offset); + event->setOffset(offset); } } if(callbackManager) @@ -977,7 +961,7 @@ namespace Tizen1_0 { callbackManager->setOnError(onErrorForCbm); callbackManager->setObject(thisObject); } - + event->setPrivateData(DPL::StaticPointerCast<WrtDeviceApis::Commons::IEventPrivateData >(callbackManager)); event->setForAsynchronousCall(&MessagingListener::getInstance()); event->setIndex(objectPriv->getIndex()); |