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

Hyperloop - iOS: Using ES6 arrow functions in Hyperloop-related code cannot be handled

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: Hyperloop 3.1.0
    • Fix Version/s: Hyperloop 3.1.0
    • Component/s: Hyperloop
    • Labels:
      None

      Description

      When using ES6 in Hyperloop methods, e.g.

          var ButtonDelegate = Hyperloop.defineClass('ButtonDelegate', 'NSObject');
       
          ButtonDelegate.addMethod({
              selector: 'buttonPressed:',
              instance: true,
              arguments: ['UIButton'],
              callback: (sender) => { 
      //                         ^-- Here is the issue
              }
          });
      

      the build fails:

      [ERROR] An error occurred during build after 33s 538ms
      [ERROR] not sure what to do with this node (/Users/hknoechel/Documents/Apps/hyperloop-examples/Resources/iphone/alloy/controllers/button.js:58:13)
      

      The error is happening here and looks like the arrow function cannot be mapped to the FunctionExpression and falls through.

        Attachments

          Activity

            People

            • Assignee:
              hknoechel Hans Knöchel
              Reporter:
              hknoechel Hans Knöchel
              Reviewer:
              Christopher Williams
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Source Code