[TIMOB-3383] Hard crash on syntax error
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2017-06-09T16:52:02.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | defect, iphone, reported-1.6.1 |
Reporter | Kevin Whinnery |
Assignee | Ingo Muschenetz |
Created | 2011-04-15T03:43:35.000+0000 |
Updated | 2017-06-09T16:52:02.000+0000 |
Description
If you forget to specify an event handler type (as in the example below), the application crashes and does not provide any feedback to the developer aside from an Objective-C stack trace in the console which does not indicate the source of the problem. Marking as high priority because this is very difficult for a developer to debug if they have made this typo. The corresponding error on Android provides a line number and an IllegalArgumentException, indicating that two arguments were expected, which is enough information to debug.
var win = Ti.UI.createWindow({
backgroundColor:'#fff'
});
var v1 = Ti.UI.createView({
height:150,
width:200,
backgroundColor:'red'
});
win.add(v1);
v1.addEventListener(function() { //note the lack of a 'click' argument first
Ti.API.info('hello world!');
});
win.open();
rollback wrong update
Closing ticket due to time passed, any problems please open a new ticket.