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

iOS: Property check on proxy always returns true

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: Release 7.2.0
    • Fix Version/s: Release 7.5.0
    • Component/s: iOS
    • Labels:
      None
    • Story Points:
      3
    • Sprint:
      2018 Sprint 14 SDK

      Description

      Checking for property existence on Titanium proxy objects always returns true, ignoring if a property really exists or not. Various aspects of Vue/Angular and module bundling with Rollup/Webpack rely on proper existence checks for properties on our proxies.

      Steps to reproduce the behavior
      Run the following example code in a Titanium app which compares the behavior to a plain JavaScript object.

      const win = Ti.UI.createWindow();
      const plainObject = {
      	prop: 'bar',
      	func: () => {}
      };
       
      Ti.API.debug('### hasProperty check ###');
      Ti.API.debug('non-existing property');
      Ti.API.debug(`proxy: ${'foo' in win}`);
      Ti.API.debug(`plain: ${'foo' in plainObject}`);
      Ti.API.debug('existing property');
      Ti.API.debug(`proxy: ${'children' in win}`);
      Ti.API.debug(`plain: ${'prop' in plainObject}`);
      

      Actual behavior
      The property check returns true for non-existing properties on the Ti.UI.Window object.

      Expected behavior
      The property check should return true only for existing properties and false otherwise.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jvennemann Jan Vennemann
                Reporter:
                jvennemann Jan Vennemann
                Reviewer:
                Hans Knöchel
                Tester:
                Samir Mohammed
              • Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Source Code