Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26169] iOS: requiring file adds uri and id properties which are enumerable and clobber existing values

GitHub Issuen/a
TypeBug
PriorityNone
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 7.1.1, Release 7.2.0
Fix Version/sn/a
ComponentsiOS
LabelsengSchedule, parity
ReporterEwan Harris
AssigneeUnknown
Created2018-06-29T15:50:09.000+0000
Updated2019-04-09T15:38:40.000+0000

Description

Description

When requiring a JSON file on iOS the JSON object returned always contains two additional fields id and uri, where id if the filename and uri is the path relative to the Resources directory. This fields are enumerable, so when logging the file or doing Object.keys they are shown. If these fields are defined in the file (either as exports or keys in the JSON) then they are also clobbered and the internal properties are set. I imagine the code needs to be changed to be similar to the Android code where the object holds keys for exports, id, and uri and return only the exports value to the js code while keeping uri and id for internal usage

Steps to reproduce

Grab the code from and add the files to an existing project https://gist.github.com/ewanharris/b17da3b1bb0e8eafc6f8668db9ec3505

Actual

id and uri values are not set to the expected values

Expected

id and uri values should not be overriden

Comments

No comments

JSON Source