[TIMOB-4644] iOS: New properties of Titanium.UI.View beginning with "get" always link to main object
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Critical |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2012-04-25T07:42:51.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 2.1.0, Sprint 2012-09 Core |
| Components | iOS |
| Labels | core, qe-testadded, view |
| Reporter | Mikhail Yurasov |
| Assignee | Stephen Tramer |
| Created | 2011-06-15T18:01:05.000+0000 |
| Updated | 2013-11-07T05:46:46.000+0000 |
Description
New properties of Titanium.UI.View beginning with "get" always link to main object
var myApp = {};
myApp.ui = {};
myApp.ui.createMyView = function() {
var v = Ti.UI.createView({});
v.getSomething = function() {
return 100;
};
v._getSomething = function() {
return 100;
};
v.getFood = 200;
return v;
};
var myView = myApp.ui.createMyView();
alert(myView.getSomething); // [object TiUIView], shold be function
alert(myView.getSomething()); // nothing, shold be "100"
alert(myView._getSomething()); // "100" - OK
alert(myView.getFood); // [object TiUIView], shold be 200
In order for us to progress this issue, would you please edit the ticket as follows: * state your platform * state the version of the platform OS/SDK tested * state what you have tested it on - emulator or device * state your Titanium SDK version (including date + commit hash) * use the wiki markup provided, to reformat your code block (surround it with the \{code\} macro) Where possible, please use the fields provided for each piece of information Thanks
Platform: OS X 10.6.7 == Titanium Studio logs: [INFO] Titanium SDK version: 1.7.0 [INFO] iPhone Device family: universal [INFO] iPhone SDK version: 4.3 [INFO] iPhone simulated device: iphone [DEBUG] executing command: /usr/bin/killall iPhone Simulator ... [INFO] Launched application in Simulator (1.44 seconds) [DEBUG] executing command: xcodebuild -version [DEBUG] Xcode 4.0.2 [DEBUG] Build version 4A2002a [INFO] Found 4.3.2 patch installed == /Library/Application Support/Titanium/mobilesdk/version.txt: version=1.7.0 timestamp=06/06/11 18:05 githash=64155ee
Tested: There does appear to be a bug here
The same with properties beginning with "set"
Reassigning tickets, as per Tony Guntharp's request
Updated test:
Expected results:var myApp = {}; myApp.ui = {}; myApp.ui.createMyView = function() { var v = Ti.UI.createView({}); v.foo = 100; v.getSomething = function() { return v.foo; }; v.setSomething = function(val) { v.foo = val; } v.getFood = 200; return v; }; var myView = myApp.ui.createMyView(); Ti.API.info(myView.getSomething); Ti.API.info(myView.setSomething); Ti.API.info(myView.getFood); Ti.API.info(myView.getFoo); Ti.API.info(myView.getSomething())l myView.setSomething(50); Ti.API.info(myView.getSomething()); Ti.API.info(myView.getFoo()); myView.setFoo(10); Ti.API.info(myView.getFoo());Closing as Fixed. Verified as per Stramer's steps. SDK: 2.1.0.v20120605140359 Studio: 2.1.0.201206041625 OS: Snow Leopard Xcode: 4.2 Devices Tested: iPhone Simulator 5.0, iPad Simulator 4.3, iPad2 4.3.5
Anvil testcase PR https://github.com/appcelerator/titanium_mobile/pull/4887