ajaxorg/ace — Issue #635: Narcissus parser error handling sometimes throws errors in worker-javascript.js 
Author: leolannenmaki
Created: 2012-01-30 14:42:49+00:00
State: open

Using Safari 5.1 enter this piece of code:

```javascript
/*MyKlass.prototype.myFn = function myFn() {
};*/
```

Place cursor after the starting /* and press backspace twice.

```
worker-javascript.js:1571: TypeError: 'undefined' is not an object (evaluating 'chunks.pop().trim')
```

Debugging the worker-javascript.js revealed that in Chrome the error message from Narcissus is

```
"Invalid regular expression: missing /"
```

and in Safari it is

```
Unexpected token '/'
```

The error handling code assumes that the error message contains at least one colon that is used to separate the line number from the actual error message. On Safari this code throws an error as the error message doesn't contain any colons. On Chrome it doesn't throw but I guess the behavior isn't intentional.

This error happens on at least version 5b6e24dd0953e4728766bd8d6c807a48e9ec61
For some reason I haven't been able to reproduce this on http://ace.ajax.org/build/kitchen-sink.html