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:
parent
11342ef97b
commit
86e4d79ffb
2 changed files with 6 additions and 6 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue