Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-23504

iOS: Titanium proxies don't extend Object.prototype properly

    Details

    • Type: Bug
    • Status: In Progress
    • Priority: High
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: iOS
    • Labels:
      None

      Description

      Our Titanium proxies do not extend Object.prototype properly on iOS, resulting in some unexpected behavior and necessary workarounds. In general, it means our proxies don't fully act like actual JS objects.

      Some examples?

      • Well should.js should just work fine to do something like Ti.App.should.exist; but does not, because should is a function added to Object.prototype and since our proxies don't extend it, it'll fail with "undefined is not a function". You need to do should(Ti.App).exist; to work around it.
      • We can't do something like Ti.App.hasOwnProperty('apiName');, so we need to hack it to be called like so: Object.prototype.hasOwnProperty.call(Ti.App, 'apiName');

      This is showing up in my mocha unit tests since iOS fails any checks that end up looking for own properties on Titanium proxies.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                cwilliams Christopher Williams
                Reporter:
                cwilliams Christopher Williams
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-9818
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Integration