fix duplicate comments on property key shorthands - fixes #234
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
var t = require("../../types");
|
||||
var _ = require("lodash");
|
||||
|
||||
exports.Property = function (node) {
|
||||
if (!node.shorthand) return;
|
||||
node.shorthand = false;
|
||||
node.key = t.removeComments(_.clone(node.key));
|
||||
};
|
||||
|
||||
@@ -295,11 +295,6 @@ t.inheritsComments = function (child, parent) {
|
||||
return child;
|
||||
};
|
||||
|
||||
t.removeComments = function (node) {
|
||||
delete node.leadingComments;
|
||||
delete node.trailingComments;
|
||||
};
|
||||
|
||||
t.inherits = function (child, parent) {
|
||||
child.loc = parent.loc;
|
||||
child.end = parent.end;
|
||||
|
||||
Reference in New Issue
Block a user