Compare commits

...

5 Commits

Author SHA1 Message Date
Sebastian McKenzie
ee782f93c4 v3.1.0 2015-01-30 10:13:50 +11:00
Sebastian McKenzie
9ed6aa48a0 add esdiscuss link to class enumerability change - @thejameskyle 2015-01-30 10:11:26 +11:00
Sebastian McKenzie
ecebedd5a2 update esnext class tests 2015-01-30 10:11:11 +11:00
Sebastian McKenzie
31df576d26 make class methods nonenumerable - fixes #639 2015-01-30 10:05:17 +11:00
Sebastian McKenzie
63d6335d99 3.0.16 2015-01-30 00:18:32 +11:00
19 changed files with 30 additions and 24 deletions

View File

@@ -11,6 +11,11 @@
_Note: Gaps between patch versions are faulty/broken releases._
## 3.1.0
* **Breaking Change**
* [Make class methods unenumerable](/Users/sebastian/Projects/6to5/6to5/test/fixtures/esnext/es6-classes/getter-setter.js).
## 3.0.16
* **Bug Fix**

View File

@@ -231,6 +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));
};
/**

View File

@@ -81,7 +81,7 @@ exports.sourceMapToComment = function (map) {
return "//# sourceMappingURL=data:application/json;base64," + base64;
};
exports.pushMutatorMap = function (mutatorMap, key, kind, computed, method) {
exports.pushMutatorMap = function (mutatorMap, key, kind, computed, value) {
var alias;
if (t.isIdentifier(key)) {
@@ -106,7 +106,7 @@ exports.pushMutatorMap = function (mutatorMap, key, kind, computed, method) {
map._computed = true;
}
map[kind] = method;
map[kind] = value;
};
exports.buildDefineProperties = function (mutatorMap) {
@@ -121,7 +121,7 @@ exports.buildDefineProperties = function (mutatorMap) {
map.writable = t.literal(true);
}
map.enumerable = t.literal(true);
map.enumerable = map.enumerable || t.literal(true);
map.configurable = t.literal(true);
each(map, function (node, key) {

View File

@@ -1,7 +1,7 @@
{
"name": "6to5",
"description": "Turn ES6 code into readable vanilla ES5 with source maps",
"version": "3.0.16",
"version": "3.1.0",
"author": "Sebastian McKenzie <sebmck@gmail.com>",
"homepage": "https://6to5.org/",
"repository": "6to5/6to5",

View File

@@ -1,7 +1,7 @@
{
"name": "6to5-runtime",
"description": "6to5 selfContained runtime",
"version": "3.0.15",
"version": "3.0.16",
"repository": "6to5/6to5",
"author": "Sebastian McKenzie <sebmck@gmail.com>"
}

View File

@@ -17,4 +17,4 @@ for (var key in point) {
}
assert.equal(point.toString(), '(1, 2)');
assert.deepEqual(keys.sort(), ['toString', 'x', 'y']);
assert.deepEqual(keys.sort(), ['x', 'y']);

View File

@@ -25,4 +25,4 @@ var forLoopProperties = [];
for (var key in mazer) {
forLoopProperties.push(key);
}
assert.ok(forLoopProperties.indexOf('name') >= 0, 'getters/setters are enumerable');
assert.ok(forLoopProperties.indexOf('name') === -1, 'getters/setters should be unenumerable');

View File

@@ -12,11 +12,11 @@ var Foo = (function () {
value: _asyncToGenerator(function* () {
var wat = yield bar();
}),
enumerable: false,
writable: true,
enumerable: true,
configurable: true
}
});
return Foo;
})();
})();

View File

@@ -12,11 +12,11 @@ var Foo = (function () {
value: _bluebird.coroutine(function* () {
var wat = yield bar();
}),
enumerable: false,
writable: true,
enumerable: true,
configurable: true
}
});
return Foo;
})();
})();

View File

@@ -31,8 +31,8 @@ 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,
enumerable: true,
configurable: true
}
}, {
@@ -43,8 +43,8 @@ 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,
enumerable: true,
configurable: true
}
});

View File

@@ -19,8 +19,8 @@ var Test = (function (Foo) {
value: function test() {
return _get(Object.getPrototypeOf(Test), "wow", this).call(this);
},
enumerable: false,
writable: true,
enumerable: true,
configurable: true
}
});

View File

@@ -10,10 +10,10 @@ var Test = (function () {
get: function () {
return 5 + 5;
},
enumerable: false,
set: function (val) {
this._test = val;
},
enumerable: true,
configurable: true
}
});

View File

@@ -10,7 +10,7 @@ var Test = (function () {
get: function () {
return 5 + 5;
},
enumerable: true,
enumerable: false,
configurable: true
}
});

View File

@@ -10,8 +10,8 @@ var Test = (function () {
value: function test() {
return 5 + 5;
},
enumerable: false,
writable: true,
enumerable: true,
configurable: true
}
});

View File

@@ -10,7 +10,7 @@ var Test = (function () {
set: function (val) {
this._test = val;
},
enumerable: true,
enumerable: false,
configurable: true
}
});

View File

@@ -18,8 +18,8 @@ var BaseView = (function () {
value: function foo() {
this.autoRender = true;
},
enumerable: false,
writable: true,
enumerable: true,
configurable: true
}
});

View File

@@ -8,14 +8,14 @@ var A = (function () {
_prototypeProperties(A, {
a: {
value: function a() {},
enumerable: false,
writable: true,
enumerable: true,
configurable: true
},
b: {
get: function () {},
enumerable: false,
set: function (b) {},
enumerable: true,
configurable: true
}
});

View File

@@ -12,14 +12,14 @@ var Foo = (function () {
get: function () {
return _defineProperty(this, "bar", complex()).bar;
},
enumerable: true,
enumerable: false,
configurable: true
}
}, bar, {
get: function () {
return _defineProperty(this, bar, complex())[bar];
},
enumerable: true,
enumerable: false,
configurable: true
}));

View File

@@ -10,7 +10,7 @@ var Test = (function () {
get: function () {
throw new Error("wow");
},
enumerable: true,
enumerable: false,
configurable: true
}
});