Compare commits

...

6 Commits

Author SHA1 Message Date
Sebastian McKenzie
16a94a769a v3.1.1 2015-01-30 11:02:28 +11:00
Sebastian McKenzie
f7c7918efe add 3.1.1 changelog 2015-01-30 11:00:43 +11:00
Sebastian McKenzie
bf393c025f properly transform XJSIdentifier nodes referencing this into a ThisExpression - facebook/react#2927 2015-01-30 11:00:37 +11:00
Sebastian McKenzie
bbbc9c0c5e remove redundant enumerable: true property on class methods 2015-01-30 10:44:33 +11:00
Sebastian McKenzie
579db9107f fix link in 3.1.0 changelog - thanks @AluisioASG - closes #641 2015-01-30 10:42:52 +11:00
Sebastian McKenzie
d1d30e9ec9 3.1.0 2015-01-30 10:15:09 +11:00
20 changed files with 30 additions and 22 deletions

View File

@@ -11,10 +11,17 @@
_Note: Gaps between patch versions are faulty/broken releases._
## 3.1.1
* **Polish**
* Drop `enumerable: false` clause from class method definitions as `enumerable` already defaults to `false`.
* **Bug Fix**
* Properly transform `XJSIdentifier` nodes referencing `this` into a `ThisExpression`.
## 3.1.0
* **Breaking Change**
* [Make class methods unenumerable](/Users/sebastian/Projects/6to5/6to5/test/fixtures/esnext/es6-classes/getter-setter.js).
* [Make class methods unenumerable](https://esdiscuss.org/topic/classes-and-enumerability#content-61).
## 3.0.16

View File

@@ -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);
};
/**

View File

@@ -8,8 +8,10 @@
var esutils = require("esutils");
var t = require("../../../types");
exports.JSXIdentifier = function (node) {
if (esutils.keyword.isIdentifierName(node.name)) {
exports.JSXIdentifier = function (node, parent) {
if (node.name === "this" && t.isReferenced(node, parent)) {
return t.thisExpression();
} else if (esutils.keyword.isIdentifierName(node.name)) {
node.type = "Identifier";
} else {
return t.literal(node.name);

View File

@@ -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) {

View File

@@ -1,7 +1,7 @@
{
"name": "6to5",
"description": "Turn ES6 code into readable vanilla ES5 with source maps",
"version": "3.1.0",
"version": "3.1.1",
"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.16",
"version": "3.1.0",
"repository": "6to5/6to5",
"author": "Sebastian McKenzie <sebmck@gmail.com>"
}

View File

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

View File

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

View File

@@ -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
}

View File

@@ -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
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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
}

View File

@@ -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
}));

View File

@@ -0,0 +1,3 @@
var foo = function () {
return () => <this />;
};

View File

@@ -0,0 +1,6 @@
var foo = function () {
var _this = this;
return function () {
return React.createElement(_this, null);
};
};

View File

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