[TIMOB-23489] iOS: read-only properties with no setter show as configurable: true
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Not Our Bug |
Resolution Date | 2016-07-06T14:54:06.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | Christopher Williams |
Assignee | Christopher Williams |
Created | 2016-06-09T23:46:24.000+0000 |
Updated | 2017-03-24T18:54:49.000+0000 |
Description
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. However you currently can delete them (since the configurable property is true on the property descriptor):
Ti.API.info('original version:' + Ti.App.version);
delete Ti.App.version;
Ti.API.info('deleted version:' + Ti.App.version);
As per [~kota]: Confirmed that JavaScriptCore doesn't handle enumerable and configurable well with getOwnPropertyDescriptor even on OS X. I assume it doesn't work well on iOS too. Found WebKit bug reports related to this: https://bugs.webkit.org/show_bug.cgi?id=158116 https://bugs.webkit.org/show_bug.cgi?id=151348 Maybe related: https://github.com/adobe/webkit/blob/master/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h#L216
Closing ticket with reference to the previous comments.