[TIMOB-2392] iOS: Drillbit regression: kroll.js
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Won't Fix |
Resolution Date | 2013-11-15T20:53:52.000+0000 |
Affected Version/s | Release 3.0.0 |
Fix Version/s | n/a |
Components | iOS |
Labels | SupportTeam, core, hard_to_verify, regression |
Reporter | Stephen Tramer |
Assignee | Ingo Muschenetz |
Created | 2011-04-15T03:18:29.000+0000 |
Updated | 2017-03-22T18:16:35.000+0000 |
Description
Test fails customObjects:53
view.customObj = {};
view.customObj.test = "hello";
valueOf(view.customObj.test).shouldBe("hello");
Note that view.customObj = { test:"hello" } passes. Probably has to do with objects being presented as raw NSDictionary, and not translating property accessors as [setValue:forKey:].
Okay - this is super serious, and a massive overhaul. Here's the full story:
There are two solutions:
Going to strongly recommend the latter and push this for 1.6.0 but expect it to become a "future".
Going to assign for M05 as part of "massive meeting."
Tagging for inclusion in 1.7 since we don't have a milestone yet.
removing release- tag as it's for committed code. Using tbs-1.7.0 to find items we know need to go in the next release.
Going to strongly recommend we schedule this out of 1.8.0 as it is a significant Kroll layer change.
The issue here is that it's a 'rewrite Titanium' issue. The way Titanium on iOS works is that there's a native object (TiProxy) underlying all Titanium JS objects. The data stored in TiProxy are wildly different than JS objects, partially because NSObjects can be threadsafe, and JSCore is explicitly not threadsafe. In order to make this really happen:
Enforce single context running at a time.
Modify the KrollObject behavior so that the JS portion stores away adhoc properties.
Introduce a means to indicate which properties are stored on proxy
Modify all Titanium classes to implement this.
Document which properties still copy-on-read and copy-on-write for safety issues (eg., Ti.UI.TableView's data and sections properties)
(I'm probably forgetting a lot more about it)Hi, I think this bug related to how titanium marshall objects between iOS and JS. AFAIK it just copies them, example below demonstrates that. {noformat} var array = [1,2] var view = Ti.UI.createView() view.array = array view.array[3] = 3 console.log(array) //[1,2] expecting [1,2,3] console.log(view.array) //[1,2] expecting [1,2,3] array[3] = 3 console.log(array) //[1,2,3] as it should be console.log(view.array) //[1,2] expecting [1,2,3] {noformat} You can also get stack overflow if you assign a complex JS object with cycles to proxy property due to the copying process.
We're not going to be addressing this particular issue for two reasons:
Drillbit has been superseded by Anvil
Ti.Next will take a different architecture approach not involving a Kroll layer per se.
The value in fixing this is outweighed by the amount of effort it would take that is better spent on other areas.Closing ticket as the issue will not fix and with reference to the above comments.