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

Code Analyzer: Native methods that modify their objects don't respect ambiguous blocks

    Details

      Description

      If a native method is called that modifies the base object and is in an ambiguous block, it needs to convert the object to unknown. For example:

      var x = ['1', '2', '3'];
      if (Date.now()) {
      	delete x[2];
      } else {
      	x[2] = x[2].length + 1;
      }
      console.log(x.join());
      

      both branches of the if are evaluated, but the first branch is evaluated first and deletes x[2] before the second branch is evaluated, resulting in a "undefined value has no property "length"" exception. Instead, the array needs to be converted to unknown.

        Attachments

          Activity

            People

            • Assignee:
              bhughes Bryan Hughes
              Reporter:
              bhughes Bryan Hughes
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Integration