Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3383] Hard crash on syntax error

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2017-06-09T16:52:02.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelsdefect, iphone, reported-1.6.1
ReporterKevin Whinnery
AssigneeIngo Muschenetz
Created2011-04-15T03:43:35.000+0000
Updated2017-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();

Comments

  1. Nikolai Derzhak 2011-04-15

    rollback wrong update
  2. Lee Morris 2017-06-09

    Closing ticket due to time passed, any problems please open a new ticket.

JSON Source