[TIMOB-27509] Android: Ti.UI.WebView.evalJS returns double-quoted string values
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | None |
| Status | Open |
| Resolution | Unresolved |
| Affected Version/s | Release 8.2.1 |
| Fix Version/s | n/a |
| Components | Android |
| Labels | engSchedule |
| Reporter | Christopher Williams |
| Assignee | Unknown |
| Created | 2019-10-29T17:29:35.000+0000 |
| Updated | 2019-10-29T17:32:16.000+0000 |
Description
See https://github.com/appcelerator/titanium-mobile-mocha-suite/blob/master/Resources/ti.ui.webview.test.js#L410
On iOS we get an actual String result, say 'http://google.com', whereas on Android we get a quoted string: '"http://google.com"'.
According to our API docs (https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.WebView-method-evalJS) we say we return a string to it may make sense to then double quote a string to differentiate between a literal
true versus string 'true'. But I think we should investigate parity issues here (and the docs) and consider retuning the "raw" value resulting on both platforms, rather than a value that you'd need to JSON.parse() or eval() yourself once you got it. (In other words, change the documented return type(s) to: object, number, boolean, string, undefined.)
No comments