Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27509] Android: Ti.UI.WebView.evalJS returns double-quoted string values

GitHub Issuen/a
TypeBug
PriorityNone
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 8.2.1
Fix Version/sn/a
ComponentsAndroid
LabelsengSchedule
ReporterChristopher Williams
AssigneeUnknown
Created2019-10-29T17:29:35.000+0000
Updated2019-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.)

Comments

No comments

JSON Source