diff --git a/lib/6to5/transformation/transformers/es6/classes.js b/lib/6to5/transformation/transformers/es6/classes.js index 9254aed6dc..acd0af6087 100644 --- a/lib/6to5/transformation/transformers/es6/classes.js +++ b/lib/6to5/transformation/transformers/es6/classes.js @@ -231,7 +231,7 @@ Class.prototype.pushMethod = function (node) { } util.pushMutatorMap(mutatorMap, methodName, kind, node.computed, node); - util.pushMutatorMap(mutatorMap, methodName, "enumerable", node.computed, t.literal(false)); + util.pushMutatorMap(mutatorMap, methodName, "enumerable", node.computed, false); }; /** diff --git a/lib/6to5/util.js b/lib/6to5/util.js index 01f2a3ab6f..bf541e1a8a 100644 --- a/lib/6to5/util.js +++ b/lib/6to5/util.js @@ -121,7 +121,12 @@ exports.buildDefineProperties = function (mutatorMap) { map.writable = t.literal(true); } - map.enumerable = map.enumerable || t.literal(true); + if (map.enumerable === false) { + delete map.enumerable; + } else { + map.enumerable = t.literal(true); + } + map.configurable = t.literal(true); each(map, function (node, key) { diff --git a/test/fixtures/transformation/async-to-generator/async/expected.js b/test/fixtures/transformation/async-to-generator/async/expected.js index 46757fa562..7a1578f1ca 100644 --- a/test/fixtures/transformation/async-to-generator/async/expected.js +++ b/test/fixtures/transformation/async-to-generator/async/expected.js @@ -12,7 +12,6 @@ var Foo = (function () { value: _asyncToGenerator(function* () { var wat = yield bar(); }), - enumerable: false, writable: true, configurable: true } diff --git a/test/fixtures/transformation/bluebird-coroutines/class/expected.js b/test/fixtures/transformation/bluebird-coroutines/class/expected.js index 4ba85d6b57..9217530fdc 100644 --- a/test/fixtures/transformation/bluebird-coroutines/class/expected.js +++ b/test/fixtures/transformation/bluebird-coroutines/class/expected.js @@ -12,7 +12,6 @@ var Foo = (function () { value: _bluebird.coroutine(function* () { var wat = yield bar(); }), - enumerable: false, writable: true, configurable: true } diff --git a/test/fixtures/transformation/es6-classes/accessing-super-class/expected.js b/test/fixtures/transformation/es6-classes/accessing-super-class/expected.js index f55a8730e7..264c6a4146 100644 --- a/test/fixtures/transformation/es6-classes/accessing-super-class/expected.js +++ b/test/fixtures/transformation/es6-classes/accessing-super-class/expected.js @@ -31,7 +31,6 @@ var Test = (function (Foo) { _get(Object.getPrototypeOf(Test), "foo", this).apply(this, arguments); (_get2 = _get(Object.getPrototypeOf(Test), "foo", this)).call.apply(_get2, [this, "test"].concat(_slice.call(arguments))); }, - enumerable: false, writable: true, configurable: true } @@ -43,7 +42,6 @@ var Test = (function (Foo) { _get(Object.getPrototypeOf(Test.prototype), "test", this).apply(this, arguments); (_get2 = _get(Object.getPrototypeOf(Test.prototype), "test", this)).call.apply(_get2, [this, "test"].concat(_slice.call(arguments))); }, - enumerable: false, writable: true, configurable: true } diff --git a/test/fixtures/transformation/es6-classes/calling-super-properties/expected.js b/test/fixtures/transformation/es6-classes/calling-super-properties/expected.js index ee2d3d5e50..b83d270ae3 100644 --- a/test/fixtures/transformation/es6-classes/calling-super-properties/expected.js +++ b/test/fixtures/transformation/es6-classes/calling-super-properties/expected.js @@ -19,7 +19,6 @@ var Test = (function (Foo) { value: function test() { return _get(Object.getPrototypeOf(Test), "wow", this).call(this); }, - enumerable: false, writable: true, configurable: true } diff --git a/test/fixtures/transformation/es6-classes/instance-getter-and-setter/expected.js b/test/fixtures/transformation/es6-classes/instance-getter-and-setter/expected.js index bcfbfba8b0..031271c3b8 100644 --- a/test/fixtures/transformation/es6-classes/instance-getter-and-setter/expected.js +++ b/test/fixtures/transformation/es6-classes/instance-getter-and-setter/expected.js @@ -10,7 +10,6 @@ var Test = (function () { get: function () { return 5 + 5; }, - enumerable: false, set: function (val) { this._test = val; }, diff --git a/test/fixtures/transformation/es6-classes/instance-getter/expected.js b/test/fixtures/transformation/es6-classes/instance-getter/expected.js index a395fed7b2..2dc7c8a867 100644 --- a/test/fixtures/transformation/es6-classes/instance-getter/expected.js +++ b/test/fixtures/transformation/es6-classes/instance-getter/expected.js @@ -10,7 +10,6 @@ var Test = (function () { get: function () { return 5 + 5; }, - enumerable: false, configurable: true } }); diff --git a/test/fixtures/transformation/es6-classes/instance-method/expected.js b/test/fixtures/transformation/es6-classes/instance-method/expected.js index 7942e5432c..141bd252f7 100644 --- a/test/fixtures/transformation/es6-classes/instance-method/expected.js +++ b/test/fixtures/transformation/es6-classes/instance-method/expected.js @@ -10,7 +10,6 @@ var Test = (function () { value: function test() { return 5 + 5; }, - enumerable: false, writable: true, configurable: true } diff --git a/test/fixtures/transformation/es6-classes/instance-setter/expected.js b/test/fixtures/transformation/es6-classes/instance-setter/expected.js index 2ceeae6b7b..b45f7b9668 100644 --- a/test/fixtures/transformation/es6-classes/instance-setter/expected.js +++ b/test/fixtures/transformation/es6-classes/instance-setter/expected.js @@ -10,7 +10,6 @@ var Test = (function () { set: function (val) { this._test = val; }, - enumerable: false, configurable: true } }); diff --git a/test/fixtures/transformation/es6-classes/statement/expected.js b/test/fixtures/transformation/es6-classes/statement/expected.js index d7785a9d86..a54f9ae84a 100644 --- a/test/fixtures/transformation/es6-classes/statement/expected.js +++ b/test/fixtures/transformation/es6-classes/statement/expected.js @@ -18,7 +18,6 @@ var BaseView = (function () { value: function foo() { this.autoRender = true; }, - enumerable: false, writable: true, configurable: true } diff --git a/test/fixtures/transformation/es6-classes/static/expected.js b/test/fixtures/transformation/es6-classes/static/expected.js index 86d959a87e..08f1142ffa 100644 --- a/test/fixtures/transformation/es6-classes/static/expected.js +++ b/test/fixtures/transformation/es6-classes/static/expected.js @@ -8,13 +8,11 @@ var A = (function () { _prototypeProperties(A, { a: { value: function a() {}, - enumerable: false, writable: true, configurable: true }, b: { get: function () {}, - enumerable: false, set: function (b) {}, configurable: true } diff --git a/test/fixtures/transformation/playground/object-getter-memoization/expected.js b/test/fixtures/transformation/playground/object-getter-memoization/expected.js index 961fd6eb58..6476a64b68 100644 --- a/test/fixtures/transformation/playground/object-getter-memoization/expected.js +++ b/test/fixtures/transformation/playground/object-getter-memoization/expected.js @@ -12,14 +12,12 @@ var Foo = (function () { get: function () { return _defineProperty(this, "bar", complex()).bar; }, - enumerable: false, configurable: true } }, bar, { get: function () { return _defineProperty(this, bar, complex())[bar]; }, - enumerable: false, configurable: true })); diff --git a/test/fixtures/transformation/source-maps/class/expected.js b/test/fixtures/transformation/source-maps/class/expected.js index f86538a7d5..40b4dc7220 100644 --- a/test/fixtures/transformation/source-maps/class/expected.js +++ b/test/fixtures/transformation/source-maps/class/expected.js @@ -10,7 +10,6 @@ var Test = (function () { get: function () { throw new Error("wow"); }, - enumerable: false, configurable: true } });