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

Early return from CoffeeScript.compile when header not enabled

This commit is contained in:
Trevor Burnham 2012-01-10 14:00:29 -05:00
parent 11342ef97b
commit 86e4d79ffb
2 changed files with 6 additions and 6 deletions

View file

@ -38,17 +38,16 @@
if (options == null) options = {};
merge = exports.helpers.merge;
try {
if (options.header) {
header = "// Generated by CoffeeScript " + this.VERSION + "\n";
}
js = (parser.parse(lexer.tokenize(code))).compile(options);
return "" + [header] + js;
if (!options.header) return js;
} catch (err) {
if (options.filename) {
err.message = "In " + options.filename + ", " + err.message;
}
throw err;
}
header = "Generated by CoffeeScript " + this.VERSION;
return "// " + header + "\n" + js;
};
exports.tokens = function(code, options) {