Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4074] iOS: KitchenSink reports script error when running Platform>Passing Data (windows)

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-05-24T14:35:12.000+0000
Affected Version/sRelease 1.7.0
Fix Version/sBacklog
ComponentsiOS
LabelsKitchenSink
ReporterEric Merriman
AssigneeBlain Hamon
Created2011-05-13T11:05:58.000+0000
Updated2011-05-24T14:35:12.000+0000

Description

Description: While running KS, Platform>Passing Data (windows), the view came up empty and the console reported errors: Fri May 13 09:59:44 unknown UIKitApplication:com.appcelerator.pushtest[0x93b2][5058] : [ERROR] Script Error = Result of expression 'win.myFunc' [undefined] is not a function. at custom_properties_2.js (line 1). Fri May 13 09:59:44 unknown UIKitApplication:com.appcelerator.pushtest[0x93b2][5058] : [ERROR] application received error: Result of expression 'win.myFunc' [undefined] is not a function. at custom_properties_2.js (line 1) Steps to reproduce: 1) Install KS 2) navigate to Platform>Passing Data (windows) 3) Click "launch window" Result: Empty page and console errors Expected result: Notes: Does not occur on 1.6.2

Attachments

FileDateSize
app.js2011-05-23T15:10:02.000+0000564
app.js2011-05-19T09:55:45.000+0000523
com.test.js2011-05-23T15:10:02.000+000077
opening.js2011-05-23T15:10:02.000+0000230
opening.js2011-05-19T09:55:45.000+0000139

Comments

  1. Stephen Tramer 2011-05-18

    Tested iPad (Universal KS)/4.3.3.
  2. Stephen Tramer 2011-05-18

    Have to let Blain log his hours!
  3. Blain Hamon 2011-05-18

    Forgot to log the hours before it got closed. Whoops.
  4. Stephen Tramer 2011-05-18

    Blain logged work, can close now for reals.
  5. Stephen Tramer 2011-05-19

    Issue found by the community: https://github.com/appcelerator/titanium_mobile/commit/7bef2bd0bcb7abbded1b9cccbbd187ee056788d7#commitcomment-390894
  6. Blain Hamon 2011-05-19

    Turns out that contexts sharing functions leads to all sorts of crazy threading issues, and may have been a cause of crashers in the past. As a workaround, eventListeners ARE threadsafe, and while Ti.App event listeners have an issue with native items (TIMOB-4155) event listeners on native items work. For example, the workaround for the example provided would be thusly: {{ App.js: var win = Ti.UI.createWindow(); var b = Ti.UI.createButton({ title:'Open', width:140, height:40 }); win.add(b); b.addEventListener('click', function() { var w = Ti.UI.createWindow({ url:'opening.js' }); w.addEventListener('rotateLeft',function (e){ var the_view = e.view; var angle = e.angle; var duration=e.duration; if(the_view==null || the_view==undefined){ return; } var t = Ti.UI.create2DMatrix(); t = t.rotate(angle); var a = Titanium.UI.createAnimation(); a.transform = t; a.duration = duration; the_view.animate(a); }); w.open(); }); win.open(); opening.js: var win = Ti.UI.currentWindow; var v = Ti.UI.createView({backgroundColor:'red', width:100, height:100}); win.add(v); win.fireEvent('rotateLeft',{view:v,angle:45,duration:0.2}); }}
  7. Blain Hamon 2011-05-23

    To be bug-compatible, when a proxy is being made in the wrong context, we register in the current context just to ensure it's still out and about.
  8. Eric Merriman 2011-05-24

    Verified fixed with iPad 3.2.3 and iPad 4.3, Titanium Studio, build: 1.0.0.201105131803, Titanium SDK version: 1.7.X r3982f4e7.

JSON Source