[ 
https://issues.apache.org/jira/browse/CB-11737?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15432371#comment-15432371
 ] 

Shazron Abdullah commented on CB-11737:
---------------------------------------

Failing test:
{code}
- (void)testSerializingMessageAsInfinityNumber
{
    NSNumber* num = [NSNumber numberWithDouble:INFINITY];
    CDVPluginResult* result = [CDVPluginResult 
resultWithStatus:CDVCommandStatus_OK messageAsDouble:INFINITY];
    
    XCTAssertTrue([num isEqual:[[result argumentsAsJSON] cdv_JSONFragment]]);
}
{code}

Fix would be in CDVPluginResult::argumentsAsJSON, we need to check each array 
element, if its a NSNumber, and its NaN or INFINITY, convert it to another 
representation. The problem is testing the conversion back.

> cordova-ios crash in case of Infinity value in result
> -----------------------------------------------------
>
>                 Key: CB-11737
>                 URL: https://issues.apache.org/jira/browse/CB-11737
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>            Reporter: Chris Brody
>            Assignee: Shazron Abdullah
>
> In case an iOS plugin attempts to return a JSON result with an Infinity value 
> it will crash with NSInvalidArgumentException. I discovered this when 
> investigating this issue: 
> https://github.com/litehelpers/Cordova-sqlite-storage/issues/405
> Similar to: CB-9435



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to