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 result = util.generate(ast, opts);
|
||||
var code = result.code;
|
||||
|
||||
if (this.shebang) {
|
||||
// add back shebang
|
||||
result.code = this.shebang + result.code;
|
||||
code = this.shebang + code;
|
||||
}
|
||||
|
||||
if (opts.sourceMap === "inline") {
|
||||
result.code += "\n" + util.sourceMapToComment(result.map);
|
||||
code += "\n" + util.sourceMapToComment(map);
|
||||
}
|
||||
|
||||
result.map = result.map || null;
|
||||
result.ast = ast;
|
||||
|
||||
return result;
|
||||
return {
|
||||
code: code,
|
||||
map: result.map || null,
|
||||
ast: ast
|
||||
};
|
||||
};
|
||||
|
||||
File.prototype.generateUid = function (name) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user