[ALOY-1032] Mobileweb: Application Error using JSON.stringify on a UI object
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Resolved |
Resolution | Duplicate |
Resolution Date | 2014-05-27T23:49:07.000+0000 |
Affected Version/s | Alloy 1.4.0, Alloy 1.3.1 |
Fix Version/s | n/a |
Components | n/a |
Labels | qe-3.2.3 |
Reporter | Federico Casali |
Assignee | Unknown |
Created | 2014-05-27T23:42:07.000+0000 |
Updated | 2018-03-07T22:25:45.000+0000 |
Description
Problem description
On Mobileweb, an Application Error is raised if using JSON.stringify and passing an object defined in the Views .xml part.Steps to reproduce
1. Run the following sample code on Mobileweb:
function doClick(e) {
alert($.label.text);
}
Ti.API.info('#### ' + JSON.stringify($.label));
$.index.open();
<Alloy>
<Window class="container">
<Label class='mainLabel' id="label" onClick="doClick"></Label>
</Window>
</Alloy>
Result: Application Error when running the app. Error message: "Uncaught TypeError: Converting circular structure to JSON at /index.html (line 37)". See screenshot attached.
Not reproducible on iOS and Android.
Reproducible with TiSDK 3.2.3.GA / Alloy 1.3.1.GA , so not a regression.
Attachments
File | Date | Size |
---|---|---|
Screen Shot 2014-05-27 at 4.25.42 PM.png | 2014-05-27T23:43:45.000+0000 | 15021 |