babel/lib/6to5/transformation/transformers/es6/properties.shorthand.js
2015-01-21 23:04:31 +11:00

18 lines
424 B
JavaScript

"use strict";
var nameMethod = require("../../helpers/name-method");
var t = require("../../../types");
var _ = require("lodash");
exports.Property = function (node, parent, scope, context, file) {
if (node.method) {
node.method = false;
nameMethod.property(node, file, scope);
}
if (node.shorthand) {
node.shorthand = false;
node.key = t.removeComments(_.clone(node.key));
}
};