return vanilla object instead of modifying the recast PrintResult
This commit is contained in:
parent
04466e3fea
commit
c9f56b838f
@ -95,20 +95,22 @@ File.prototype.generate = function () {
|
|||||||
var ast = this.ast;
|
var ast = this.ast;
|
||||||
|
|
||||||
var result = util.generate(ast, opts);
|
var result = util.generate(ast, opts);
|
||||||
|
var code = result.code;
|
||||||
|
|
||||||
if (this.shebang) {
|
if (this.shebang) {
|
||||||
// add back shebang
|
// add back shebang
|
||||||
result.code = this.shebang + result.code;
|
code = this.shebang + code;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opts.sourceMap === "inline") {
|
if (opts.sourceMap === "inline") {
|
||||||
result.code += "\n" + util.sourceMapToComment(result.map);
|
code += "\n" + util.sourceMapToComment(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
result.map = result.map || null;
|
return {
|
||||||
result.ast = ast;
|
code: code,
|
||||||
|
map: result.map || null,
|
||||||
return result;
|
ast: ast
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
File.prototype.generateUid = function (name) {
|
File.prototype.generateUid = function (name) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user