Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23489] iOS: read-only properties with no setter show as configurable: true

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionNot Our Bug
Resolution Date2016-07-06T14:54:06.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterChristopher Williams
AssigneeChristopher Williams
Created2016-06-09T23:46:24.000+0000
Updated2017-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);

Comments

  1. Christopher Williams 2016-07-06

    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
  2. Lee Morris 2017-03-24

    Closing ticket with reference to the previous comments.

JSON Source