diff --git a/lib/6to5/transformation/transformers/es6-property-method-assignment.js b/lib/6to5/transformation/transformers/es5-property.mutators.js similarity index 66% rename from lib/6to5/transformation/transformers/es6-property-method-assignment.js rename to lib/6to5/transformation/transformers/es5-property.mutators.js index 4a740e2f83..9ca360fd94 100644 --- a/lib/6to5/transformation/transformers/es6-property-method-assignment.js +++ b/lib/6to5/transformation/transformers/es5-property.mutators.js @@ -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 = {}; diff --git a/lib/6to5/transformation/transformers/es6-property-name-shorthand.js b/lib/6to5/transformation/transformers/es6-property-name-shorthand.js deleted file mode 100644 index 006fc9325b..0000000000 --- a/lib/6to5/transformation/transformers/es6-property-name-shorthand.js +++ /dev/null @@ -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)); -}; diff --git a/lib/6to5/transformation/transformers/es6-computed-property-names.js b/lib/6to5/transformation/transformers/es6-property.computed.js similarity index 100% rename from lib/6to5/transformation/transformers/es6-computed-property-names.js rename to lib/6to5/transformation/transformers/es6-property.computed.js diff --git a/lib/6to5/transformation/transformers/es6-property.shorthand.js b/lib/6to5/transformation/transformers/es6-property.shorthand.js new file mode 100644 index 0000000000..9792975d8d --- /dev/null +++ b/lib/6to5/transformation/transformers/es6-property.shorthand.js @@ -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)); + } +};