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

iOS: ES6 promises not supported on iOS 9. (Works on iOS 8 and 10.)

    Details

    • Story Points:
      5
    • Sprint:
      2018 Sprint 13 SDK

      Description

      Summary:
      JavaScript ES6 "promises" are not supported on iOS 9 when setting "tiapp.xml" setting <transpile>true</transpile>.

      However, promises are supported on iOS 8 and iOS 10.

      Steps to reproduce:

      1. Set up a project's "tiapp.xml" with the below "transpile" setting.
      2. Build and run the below code on iOS 9.

      <?xml version="1.0" encoding="UTF-8"?>
      <ti:app xmlns:ti="http://ti.appcelerator.org">
      	<transpile>true</transpile>
      </ti:app>
      

      Ti.API.info("@@@ typeof Promise: " + (typeof Promise));
      var promise = new Promise(function(resolve, reject) {
      	Ti.API.info("@@@ Promise execution started.");
      	setTimeout(function() {
      		Ti.API.info("@@@ Promise execution ended.");
      		resolve();
      //		reject();
      	}, 1000);
      }).then(function() {
      	Ti.API.info("@@@ Promise.then() called.");
      }).catch(function(e) {
      	Ti.API.info("@@@ Promise.catch() called.");
      });
      

      Result:
      An exception dialog is displayed stating "Can't find variable: Promise".

      Notes:

      • This issue does not happen in iOS 8.1 and 8.4 simulators.
      • This issue does not happen in iOS 10.3.1 simulator.
      • I verified that this issue happens in iOS 9.0 and 9.3 simulator.
      • I've tried setting "tiapp.xml" <transpile> setting true and false. No difference. Always fails on iOS 9.x Setting <transpile> to false surprisingly works on iOS 8.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gmathews Gary Mathews
                Reporter:
                jquick Joshua Quick
                Reviewer:
                Christopher Williams
                Tester:
                Samir Mohammed
              • Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Source Code