better names for property transformers

This commit is contained in:
Sebastian McKenzie 2015-01-21 22:41:55 +11:00
parent 019f2ee932
commit 0d0d89fd9c
4 changed files with 17 additions and 21 deletions

View File

@ -1,16 +1,7 @@
"use strict";
var nameMethod = require("../helpers/name-method");
var util = require("../../util");
var t = require("../../types");
exports.Property = function (node, parent, scope, context, file) {
if (!node.method) return;
node.method = false;
nameMethod.property(node, file, scope);
};
var util = require("../../util");
var t = require("../../types");
exports.ObjectExpression = function (node) {
var mutatorMap = {};

View File

@ -1,10 +0,0 @@
"use strict";
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));
};

View File

@ -0,0 +1,15 @@
"use strict";
var nameMethod = require("../helpers/name-method");
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));
}
};