Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2221] Regression: methods passed through contexts not returning values

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:58:27.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.5.0
ComponentsAndroid
Labelsandroid, android_refactor, defect, javascript, refactor, regression
ReporterMatthew Lieder
AssigneeMarshall Culpepper
Created2011-04-15T03:13:54.000+0000
Updated2011-04-17T01:58:27.000+0000

Description

Variable/method passing through contexts was completely broken in 1.4.1.1 on Android, but in 1.4.2 (a build from 10/7) it was fixed and working beautifully. However, now in 1.5.0 it's broken again (though not quite as broken as before).

Here's what the log shows in 1.4.2 when I run the attached testcase:

[INFO] Titanium SDK version: 1.4.2 (10/07/10 15:15 2373d78)
[INFO] Deployed Sandbox ... Application should be running.
[INFO] [194,2438] 1.0
[INFO] [14,2452] win.b() = hello
[INFO] [11,2463] {"instanceVar":123,"method":"org.appcelerator.titanium.kroll.KrollCallback@43eb9160"}
[INFO] [7,2470] 123.0
[INFO] [17,2487] function method called
[INFO] [10,2497] function getProps called
[INFO] [6,2503] win.glob.getProps(): [object Object]
[INFO] [8,2511] win.glob.getProps().propOne: property 1
[INFO] [4,2515] function getClass called
[INFO] [12,2527] win.glob.getClass(): [object Object]
[INFO] [11,2538] win.glob.getClass().instanceVar: 123

And here's what it shows in 1.5.0:

[INFO] Titanium SDK version: 1.5.0 (10/26/10 19:22 6add5e1)
[INFO] Deployed Sandbox ... Application should be running.
[INFO] [95,3090] 1.0
[INFO] [62,3152] win.b() = undefined
[INFO] [68,3220] {"instanceVar":123,"method":"org.appcelerator.titanium.kroll.KrollCallback@43ecd520"}
[INFO] [3,3223] 123.0
[INFO] [183,3406] win.glob.getProps(): undefined
[INFO] [30,3436] win.glob.getProps().propOne: undefined
[INFO] [3,3439] win.glob.getClass(): undefined
[INFO] [3,3442] win.glob.getClass().instanceVar: undefined
[INFO] [9,3451] function method called
[INFO] [2,3453] function getProps called
[INFO] [4,3457] function getClass called

Here's an abridged example from the test case:

// parent context (app.js)
var glob = {};
glob.getProps = function() {

Ti.API.info('function getProps called');

return {propOne: 'property 1', propTwo: 'property 2'};



}; win.glob = glob;
// child context (test.js) var obj = win.glob.getProps(); // runs code in method but returns undefined

Attachments

FileDateSize
app.js2011-04-15T03:13:55.000+00001054
test.js2011-04-15T03:13:55.000+0000665

Comments

  1. Matthew Lieder 2011-04-15

    This appears to be a partial regression of the fixes done in the high-priority, milestone-1.5 #1223

  2. Matthew Lieder 2011-04-15

    In case this helps, the closest potential culprit I've found is http://github.com/appcelerator/titanium_mobile/commit/26a8a4d58b667f89d8cf3ebadca4a8a95b3dfbfd"> http://github.com/appcelerator/titanium_mobile/commit/26a8a4d58b667...

  3. Don Thorp 2011-04-15

    Standardizing title and assigning over to Marshall.

  4. Matthew Lieder 2011-04-15

    Marshall, do you have any clue when you'll get around to looking at this one? Sometime this week hopefully?

  5. Marshall Culpepper 2011-04-15

    (from [2e76a75f4bd6e3b6cc46f044f07dee0646d0d53c]) use an event wrapper for the Ti.Yahoo.yql callback, enable YQL in KS, and added a new yahoo test suite. Handle undefined more gracefully in KrollConverter, and made a fix for unwrapping KrollCallback to it's source function [#755 state:fixed-in-qa] [#2221 state:fixed-in-qa] https://github.com/appcelerator/titanium_mobile/commit/2e76a75f4bd6e3b6cc46f044f07dee0646d0d53c"> https://github.com/appcelerator/titanium_mobile/commit/2e76a75f4bd6...

  6. Thomas Huelbert 2011-04-15

    Titanium SDK version: 1.5.0 (12/10/10 08:19 f37ab6c)

JSON Source