[TIMOB-2221] Regression: methods passed through contexts not returning values
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:58:27.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.5.0 |
Components | Android |
Labels | android, android_refactor, defect, javascript, refactor, regression |
Reporter | Matthew Lieder |
Assignee | Marshall Culpepper |
Created | 2011-04-15T03:13:54.000+0000 |
Updated | 2011-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
File | Date | Size |
---|---|---|
app.js | 2011-04-15T03:13:55.000+0000 | 1054 |
test.js | 2011-04-15T03:13:55.000+0000 | 665 |