From c2b20b18b3eddaf154cdb132368fb3c51ff9255d Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sun, 18 Jan 2015 18:24:05 +1100 Subject: [PATCH] make name method helper export a property method instead of a default --- lib/6to5/transformation/helpers/name-method.js | 2 +- lib/6to5/transformation/transformers/es6-classes.js | 2 +- .../transformers/es6-property-method-assignment.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/6to5/transformation/helpers/name-method.js b/lib/6to5/transformation/helpers/name-method.js index 36cdbddaea..14db11b3e9 100644 --- a/lib/6to5/transformation/helpers/name-method.js +++ b/lib/6to5/transformation/helpers/name-method.js @@ -20,7 +20,7 @@ var traverser = { } }; -module.exports = function (node, file, scope) { +exports.property = function (node, file, scope) { var key = t.toComputedKey(node, node.key); if (!t.isLiteral(key)) return node; // we can't set a function id with this diff --git a/lib/6to5/transformation/transformers/es6-classes.js b/lib/6to5/transformation/transformers/es6-classes.js index b68159d242..432b0ff2ea 100644 --- a/lib/6to5/transformation/transformers/es6-classes.js +++ b/lib/6to5/transformation/transformers/es6-classes.js @@ -195,7 +195,7 @@ Class.prototype.pushMethod = function (node) { var kind = node.kind; if (kind === "") { - nameMethod(node, this.file, this.scope); + nameMethod.property(node, this.file, this.scope); if (this.isLoose) { // use assignments instead of define properties for loose classes diff --git a/lib/6to5/transformation/transformers/es6-property-method-assignment.js b/lib/6to5/transformation/transformers/es6-property-method-assignment.js index 7237ef1c4f..776b6172cc 100644 --- a/lib/6to5/transformation/transformers/es6-property-method-assignment.js +++ b/lib/6to5/transformation/transformers/es6-property-method-assignment.js @@ -7,7 +7,7 @@ exports.Property = function (node, parent, scope, context, file) { node.method = false; - nameMethod(node, file, scope); + nameMethod.property(node, file, scope); }; exports.ObjectExpression = function (node) {