1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05:00

Syntax errors no longer report full stack traces ... just the error, please

This commit is contained in:
Jeremy Ashkenas 2013-01-06 19:12:23 -10:00
parent 82aeb70380
commit cdde576182
3 changed files with 5 additions and 3 deletions

View file

@ -51,7 +51,8 @@
if (options.filename) {
err.message = "In " + options.filename + ", " + err.message;
}
throw err;
console.error(err.message);
process.exit(1);
}
header = "Generated by CoffeeScript " + this.VERSION;
return "// " + header + "\n" + js;

View file

@ -40,7 +40,8 @@ exports.compile = compile = (code, options = {}) ->
return js unless options.header
catch err
err.message = "In #{options.filename}, #{err.message}" if options.filename
throw err
console.error err.message
process.exit 1
header = "Generated by CoffeeScript #{@VERSION}"
"// #{header}\n#{js}"

View file

@ -1935,7 +1935,7 @@ Closure =
args = []
if (mentionsArgs = expressions.contains @literalArgs) or expressions.contains @literalThis
if mentionsArgs and expressions.classBody
throw SyntaxError "Class bodies don't have arguments"
throw SyntaxError "Class bodies shouldn't reference arguments"
meth = new Literal if mentionsArgs then 'apply' else 'call'
args = [new Literal 'this']
args.push new Literal 'arguments' if mentionsArgs