Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1032] Mobileweb: Application Error using JSON.stringify on a UI object

GitHub Issuen/a
TypeBug
PriorityMedium
StatusResolved
ResolutionDuplicate
Resolution Date2014-05-27T23:49:07.000+0000
Affected Version/sAlloy 1.4.0, Alloy 1.3.1
Fix Version/sn/a
Componentsn/a
Labelsqe-3.2.3
ReporterFederico Casali
AssigneeUnknown
Created2014-05-27T23:42:07.000+0000
Updated2018-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

FileDateSize
Screen Shot 2014-05-27 at 4.25.42 PM.png2014-05-27T23:43:45.000+000015021

Comments

No comments

JSON Source