babel/lib/6to5/transformation/transformers/es6/properties.shorthand.js
2015-01-28 23:52:17 -05:00

18 lines
433 B
JavaScript

"use strict";
var nameMethod = require("../../helpers/name-method");
var t = require("../../../types");
var clone = require("lodash/lang/clone");
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));
}
};