verify that narcissus js errors are parsed correctly

fix #379
This commit is contained in:
Fabian Jakobs 2011-08-17 15:18:22 +02:00
commit 9e84157aa8
2 changed files with 11 additions and 3 deletions

View file

@ -25,10 +25,13 @@ oop.inherits(JavaScriptWorker, Mirror);
} catch(e) {
// console.log("narcissus")
// console.log(e);
var chunks = e.message.split(":")
var message = chunks.pop().trim();
var lineNumber = parseInt(chunks.pop().trim()) - 1;
this.sender.emit("narcissus", {
row: e.lineno-1,
row: lineNumber,
column: null, // TODO convert e.cursor
text: e.message,
text: message,
type: "error"
});
return;

View file

@ -63,7 +63,12 @@ module.exports = {
var worker = new JavaScriptWorker(this.sender);
worker.setValue("Juhu Kinners");
worker.deferredUpdate.call();
assert.equal(this.sender.events[0][1].type, "error");
var error = this.sender.events[0][1];
assert.equal(error.text, "missing ; before statement");
assert.equal(error.type, "error");
assert.equal(error.row, 0);
assert.equal(error.column, null);
},
"test check for narcissus bug": function() {