normalize quotes to apostrophes in error messages from javascript evaluation (unify node/rhino error message)

This commit is contained in:
Oliver Becker
2013-10-27 15:14:04 +01:00
parent 0b4ecbaea0
commit 5baa4445bc
2 changed files with 2 additions and 2 deletions

View File

@@ -36,7 +36,7 @@ tree.JavaScript.prototype = {
try {
result = expression.call(context);
} catch (e) {
throw { message: "JavaScript evaluation error: '" + e.name + ': ' + e.message + "'" ,
throw { message: "JavaScript evaluation error: '" + e.name + ': ' + e.message.replace(/["]/g, "'") + "'" ,
index: this.index };
}
if (typeof(result) === 'string') {

View File

@@ -1,4 +1,4 @@
SyntaxError: JavaScript evaluation error: 'TypeError: Cannot call method "toJS" of undefined' in {path}javascript-error.less on line 2, column 27:
SyntaxError: JavaScript evaluation error: 'TypeError: Cannot call method 'toJS' of undefined' in {path}javascript-error.less on line 2, column 27:
1 .scope {
2 var: `this.foo.toJS()`;
3 }