mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
adding source file information to all coffeescript compiles
This commit is contained in:
parent
6ce869b3fb
commit
5b9ebd19d5
4 changed files with 33 additions and 17 deletions
|
@ -90,7 +90,7 @@
|
|||
} else if (o.run) {
|
||||
return CoffeeScript.run(code, source, compile_options());
|
||||
} else {
|
||||
js = CoffeeScript.compile(code, compile_options());
|
||||
js = CoffeeScript.compile(code, compile_options(source));
|
||||
if (o.compile) {
|
||||
return write_js(source, js);
|
||||
} else if (o.lint) {
|
||||
|
@ -119,7 +119,7 @@
|
|||
}
|
||||
});
|
||||
return process.stdio.addListener('close', function() {
|
||||
return process.stdio.write(CoffeeScript.compile(code, compile_options()));
|
||||
return process.stdio.write(CoffeeScript.compile(code, compile_options('stdio')));
|
||||
});
|
||||
};
|
||||
// Watch a list of source CoffeeScript files using `fs.watchFile`, recompiling
|
||||
|
@ -203,10 +203,13 @@
|
|||
return sources = options.arguments.slice(2, options.arguments.length);
|
||||
};
|
||||
// The compile-time options to pass to the CoffeeScript compiler.
|
||||
compile_options = function compile_options() {
|
||||
return options['no-wrap'] ? {
|
||||
no_wrap: true
|
||||
} : {};
|
||||
compile_options = function compile_options(source) {
|
||||
var o;
|
||||
o = {
|
||||
source: source
|
||||
};
|
||||
o['no-wrap'] = options['no-wrap'];
|
||||
return o;
|
||||
};
|
||||
// Print the `--help` usage message and exit.
|
||||
usage = function usage() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue