Project: appceleratorstudio
Issue TISTUD-7066: Runtime error with Studio-generated function event handlers
Steps: 1. Create a new Alloy project. 2. Open views/index.xml and add a new Label element (e.g.) with an event hander that specifies a function that doesn't exist in the controller, e.g. {{}}. 3. Press Cmd+1/Ctrl+1 to open the 'Create event listener in controller file' dialog and press Enter to create the new handler. 4. Save all files and build for simulator/device. Results: Runtime error, "Can't find variable fooBar" (ios) or "fooBar is not defined" (Android). Expected: No runtime error with generated event handler. One fix is to add {{var}} before the function statement: {code} // this var blah = function(e) {	}; // instead of this blah = function(e) {	}; {code} Or, to be consistent with the default Alloy template's {{onClick}} handler: {code} function fooBar(e) { } {code}
Story points: 3