[TIMOB-24434] iOS: Unable to modify key of an Object property
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Medium |
| Status | Open |
| Resolution | Unresolved |
| Affected Version/s | Release 6.0.0, Release 6.0.1 |
| Fix Version/s | n/a |
| Components | iOS |
| Labels | n/a |
| Reporter | Yellowcube |
| Assignee | Vijay Singh |
| Created | 2017-02-27T15:25:51.000+0000 |
| Updated | 2018-10-03T11:06:44.000+0000 |
Description
- Properties which are writable Objects such as
Point and Font cannot have their keys directly changed.
*TEST CASE #1*
var win = Ti.UI.createWindow({
title: 'TIMOB-24406',
backgroundColor: 'gray'
}),
lbl = Ti.UI.createLabel({
text: 'click me',
font: {
fontSize: 24
}
});
win.addEventListener('click', function(e) {
// direct access to fontSize
lbl.font.fontSize = lbl.font.fontSize + 4;
});
win.add(lbl);
win.open();
*TEST CASE #2*
var win = Ti.UI.createWindow({
title: 'TIMOB-24406',
backgroundColor: 'gray'
}),
iv = Ti.UI.createView({
backgroundColor: 'red',
width: '320',
height: '480',
center: {
x: 1,
y: 1
}
});
win.addEventListener('click', function(e) {
iv.center.x = e.x;
iv.center.y = e.y;
//iv.center = {x: e.x, y: e.y}; // workaround
Ti.API.info('center.x: ' + iv.center.x);
Ti.API.info('center.y: ' + iv.center.y);
});
win.add(iv);
win.open();
Can we determine the affected properties before? I can think of
fontandcenter, what else?I've checked this and it's an issue with the
JSClassDefinitionimplementation in JavaScriptCore which does not handle object changes as part of thesetPropertycallback. I don't see much that we can do since thats the earliest point where we are able to receive back from JSCore.