Project: titanium
Issue TIMOB-23609: Windows: read-only properties incorrectly identify themselves as configurable
Properties like apiName on all proxies, or Ti.App.version are marked as read-only properties in our docs. That means the user should not be able to overwrite their values or delete them.On Windows, we cannot delete the property, but the common way of checking is to look at the configurable value of the property descriptor. That is oddly reporting true (which should mean it can be deleted). {code:javascript} var target = Ti.API, propName = 'apiName'; while (!Object.prototype.hasOwnProperty.call(target, propName)) { target = Object.getPrototypeOf(target); // go up the prototype chain if (!target) { alert('Failed!'); } } Ti.API.info(JSON.stringify(Object.getOwnPropertyDescriptor(Object(target), propName))); Ti.API.info(Ti.API.apiName); delete Ti.API.apiName; Ti.API.info(Ti.API.apiName); {code}
Story points: 5