Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
16a94a769a | ||
|
|
f7c7918efe | ||
|
|
bf393c025f | ||
|
|
bbbc9c0c5e | ||
|
|
579db9107f | ||
|
|
d1d30e9ec9 |
@@ -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
|
||||
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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>"
|
||||
}
|
||||
@@ -12,7 +12,6 @@ var Foo = (function () {
|
||||
value: _asyncToGenerator(function* () {
|
||||
var wat = yield bar();
|
||||
}),
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ var Foo = (function () {
|
||||
value: _bluebird.coroutine(function* () {
|
||||
var wat = yield bar();
|
||||
}),
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ var Test = (function () {
|
||||
get: function () {
|
||||
return 5 + 5;
|
||||
},
|
||||
enumerable: false,
|
||||
set: function (val) {
|
||||
this._test = val;
|
||||
},
|
||||
|
||||
@@ -10,7 +10,6 @@ var Test = (function () {
|
||||
get: function () {
|
||||
return 5 + 5;
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
}
|
||||
});
|
||||
|
||||
@@ -10,7 +10,6 @@ var Test = (function () {
|
||||
value: function test() {
|
||||
return 5 + 5;
|
||||
},
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ var Test = (function () {
|
||||
set: function (val) {
|
||||
this._test = val;
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
}
|
||||
});
|
||||
|
||||
@@ -18,7 +18,6 @@ var BaseView = (function () {
|
||||
value: function foo() {
|
||||
this.autoRender = true;
|
||||
},
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}));
|
||||
|
||||
|
||||
3
test/fixtures/transformation/react/arrow-functions/actual.js
vendored
Normal file
3
test/fixtures/transformation/react/arrow-functions/actual.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
var foo = function () {
|
||||
return () => <this />;
|
||||
};
|
||||
6
test/fixtures/transformation/react/arrow-functions/expected.js
vendored
Normal file
6
test/fixtures/transformation/react/arrow-functions/expected.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
var foo = function () {
|
||||
var _this = this;
|
||||
return function () {
|
||||
return React.createElement(_this, null);
|
||||
};
|
||||
};
|
||||
@@ -10,7 +10,6 @@ var Test = (function () {
|
||||
get: function () {
|
||||
throw new Error("wow");
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user