Uploaded image for project: 'Alloy'
  1. Alloy
  2. ALOY-1296

LiveView: functions in Alloy.js crash fail to build

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: Alloy 1.6.2
    • Fix Version/s: Alloy 1.7.1
    • Component/s: None
    • Environment:

      Appcelerator Studio, OSX, Android
      SDK: 4.1.0.GA
      CLI: 4.1.1
      iOS: 8.4
      Android 4.2.2

    • Story Points:
      8
    • Sprint:
      2015 Sprint 17 Tooling

      Description

      Problem Description

      When you create a new alloy project and define a function inside alloy.js, If you are using LiveView the application will crash

      Sample Code

      alloy.js

       
      function sum(a,b){
      	return a+ b ;
      };
      

      index.xml

      <Alloy>
      	<Window class="container">
      		<Label id="label" onClick="doClick">Appcelerator Titanium</Label>
      	</Window>
      </Alloy>
      

      index.tss

      ".container": {
      	backgroundColor:"white"
      },
      "Label": {
      	width: Ti.UI.SIZE,
      	height: Ti.UI.SIZE,
      	color: "#000"
      }
      

      index.js

      function doClick(e) {
          alert($.label.text);
      }
      $.index.open();
      

      Steps to reproduce

      • Create a simple alloy project.
      • Update alloy.js, index.xml, index.tss and index.js file with test code
      • Enable LiveView in Appcelerator Studio
      • Run on iOS simulator
      • Project crash and produce errors.

      Actual Results

      [ERROR] :  SyntaxError: Parse error
      [ERROR] :  File: app
      [ERROR] :  Line: 1
      [ERROR] :  SourceId: 316582208
      [ERROR] :  Backtrace:
      [ERROR] :   #0 () at file:///Users/rmitro/Library/Application%20Support/iPhone%20Simulator/7.1/Applications/F7F894E3-3A78-4E1D-9E4E-A54A4DDE7746/QnA_Alloy.app/app.js:502
      [ERROR] :  #1 () at file:///Users/rmitro/Library/Application%20Support/iPhone%20Simulator/7.1/Applications/F7F894E3-3A78-4E1D-9E4E-A54A4DDE7746/QnA_Alloy.app/app.js:469
      [ERROR] :  #2 () at file:///Users/rmitro/Library/Application%20Support/iPhone%20Simulator/7.1/Applications/F7F894E3-3A78-4E1D-9E4E-A54A4DDE7746/QnA_Alloy.app/app.js:403
      [ERROR] :  #3 () at file:///Users/rmitro/Library/Application%20Support/iPhone%20Simulator/7.1/Applications/F7F894E3-3A78-4E1D-9E4E-A54A4DDE7746/QnA_Alloy.app/app.js:676
      

      Extra info

      This is the error shown:

      [INFO] :   alloyJSHatesFunctions/1.0 (3.2.3.GA.b958a70)
      [LiveView] Client connected
      [INFO] :   [LiveView] Error Evaluating app @ Line: 1
      [ERROR] :  SyntaxError: Parse error
      [ERROR] :  File: app
      [ERROR] :  Line: 1
      [ERROR] :  SourceId: 350635136
      [ERROR] :  Backtrace:
      [ERROR] :   #0 () at file:///Users/andrewmcelroy/Library/Application%20Support/iphone%20simulator/7.1-64/Applications/4A49D81E-DEF2-43ED-A74C-437076DE3B4E/alloyJSHatesFunctions.app/app.js:502
      [ERROR] :  #1 () at file:///Users/andrewmcelroy/Library/Application%20Support/iphone%20simulator/7.1-64/Applications/4A49D81E-DEF2-43ED-A74C-437076DE3B4E/alloyJSHatesFunctions.app/app.js:469
      [ERROR] :  #2 () at file:///Users/andrewmcelroy/Library/Application%20Support/iphone%20simulator/7.1-64/Applications/4A49D81E-DEF2-43ED-A74C-437076DE3B4E/alloyJSHatesFunctions.app/app.js:403
      [ERROR] :  #3 () at file:///Users/andrewmcelroy/Library/Application%20Support/iphone%20simulator/7.1-64/Applications/4A49D81E-DEF2-43ED-A74C-437076DE3B4E/alloyJSHatesFunctions.app/app.js:676
      [LiveView] Client disconnected
      

        Attachments

          Activity

            People

            • Assignee:
              fmiao Feon Sua Xin Miao
              Reporter:
              mpmiranda Mauro Parra-Miranda
              Reviewer:
              Chee Kiat Ng (Inactive)
            • Watchers:
              13 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Integration