Fixes #2766 -- incompatible line number API

This commit is contained in:
Jeremy Ashkenas
2013-03-05 10:19:21 +13:00
parent b4c12f6746
commit b2b801a78b
4 changed files with 17 additions and 12 deletions

View File

@@ -85,7 +85,7 @@
header = "Generated by CoffeeScript " + this.VERSION;
js = "// " + header + "\n" + js;
}
if (options.sourceMap || options.returnObject) {
if (options.sourceMap) {
answer = {
js: js
};

View File

@@ -169,8 +169,11 @@
return compileJoin();
} else {
compiled = CoffeeScript.compile(t.input, t.options);
t.output = compiled.js;
t.sourceMap = compiled.v3SourceMap;
t.output = compiled;
if (o.sourceMap) {
t.output = compiled.js;
t.sourceMap = compiled.v3SourceMap;
}
CoffeeScript.emit('success', task);
if (o.print) {
return printLine(t.output.trim());
@@ -476,8 +479,7 @@
literate: helpers.isLiterate(filename),
bare: opts.bare,
header: opts.compile,
sourceMap: opts.map,
returnObject: true
sourceMap: opts.map
};
};