Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
751ea7a12c | ||
|
|
b30cd227cc | ||
|
|
18dc7b8143 | ||
|
|
1c628bbec1 | ||
|
|
d4c3dde02a | ||
|
|
a587106a6b | ||
|
|
9c1b60e451 | ||
|
|
0c7e0b65b9 | ||
|
|
5c17091db4 |
12
CHANGELOG.md
12
CHANGELOG.md
@@ -1,3 +1,15 @@
|
||||
# 1.12.7
|
||||
|
||||
* Update to latest `acorn-6to5`.
|
||||
|
||||
# 1.12.6
|
||||
|
||||
* Update to latest `acorn-6to5`.
|
||||
|
||||
# 1.12.5
|
||||
|
||||
* Fix excessive whitespace trimming resulting in innaccurate sourcemap line.
|
||||
|
||||
# 1.12.4
|
||||
|
||||
* Add `doc` folder for documentation.
|
||||
|
||||
@@ -26,4 +26,4 @@
|
||||
|
||||
**6to5** turns ES6 code into vanilla ES5, so you can use ES6 features **today.**
|
||||
|
||||
For more information view the [documentation](https://github.com/6to5/6to5/tree/master/doc).
|
||||
For more information view the [documentation](https://6to5.github.io).
|
||||
|
||||
@@ -61,7 +61,10 @@ better suited if you'd like a full ES6 environment with polyfills and all.
|
||||
| No runtime | ✓ | | | | ✓ | ✓ |
|
||||
| Source maps | ✓ | ✓ | ✓ | | ✓ | ✓ |
|
||||
| No compiler global pollution | ✓ | | ✓ | | ✓ | ✓ |
|
||||
| Browser support | ✓ | ✓ | ✓ | | | |
|
||||
| Array comprehension | ✓ | ✓ | | | ✓ | |
|
||||
| Arrow functions | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| Async functions | ✓ | | ✓ | | | |
|
||||
| Classes | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| Computed property names | ✓ | ✓ | ✓ | ✓ | ✓ | |
|
||||
| Constants | ✓ | ✓ | | | ✓ | |
|
||||
@@ -69,6 +72,7 @@ better suited if you'd like a full ES6 environment with polyfills and all.
|
||||
| Destructuring | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| For-of | ✓ | ✓ | ✓ | ✓ | ✓ | |
|
||||
| Generators | ✓ | ✓ | ✓ | | | |
|
||||
| Generator comprehension | ✓ | ✓ | | | | |
|
||||
| Let scoping | ✓ | ✓ | | | ✓ | |
|
||||
| Modules | ✓ | ✓ | | ✓ | | |
|
||||
| Property method assignment | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
|
||||
@@ -76,6 +76,8 @@ Buffer.prototype.newline = function (i, removeLast) {
|
||||
}
|
||||
|
||||
if (_.isNumber(i)) {
|
||||
if (this.endsWith(util.repeat(i, "\n"))) return;
|
||||
|
||||
var self = this;
|
||||
_.times(i, function () {
|
||||
self.newline(null, removeLast);
|
||||
@@ -86,7 +88,7 @@ Buffer.prototype.newline = function (i, removeLast) {
|
||||
if (removeLast && this.isLast("\n")) this.removeLast("\n");
|
||||
|
||||
this.removeLast(" ");
|
||||
this.buf = this.buf.replace(/\n(\s+)$/, "\n");
|
||||
this.buf = this.buf.replace(/\n +$/, "\n");
|
||||
this._push("\n");
|
||||
};
|
||||
|
||||
|
||||
@@ -115,8 +115,6 @@ CodeGenerator.prototype.print = function (node, parent, opts) {
|
||||
opts = opts || {};
|
||||
|
||||
var newline = function (leading) {
|
||||
var ignoreDuplicates = false;
|
||||
|
||||
if (!opts.statement && !n.isUserWhitespacable(node, parent)) {
|
||||
return;
|
||||
}
|
||||
@@ -139,7 +137,7 @@ CodeGenerator.prototype.print = function (node, parent, opts) {
|
||||
lines += needs(node, parent);
|
||||
}
|
||||
|
||||
self.newline(lines, ignoreDuplicates);
|
||||
self.newline(lines);
|
||||
};
|
||||
|
||||
if (this[node.type]) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "6to5",
|
||||
"description": "Turn ES6 code into readable vanilla ES5 with source maps",
|
||||
"version": "1.12.4",
|
||||
"version": "1.12.7",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://github.com/6to5/6to5",
|
||||
"repository": {
|
||||
@@ -48,7 +48,7 @@
|
||||
"chokidar": "0.10.5",
|
||||
"source-map-support": "0.2.8",
|
||||
"esutils": "1.1.4",
|
||||
"acorn-6to5": "https://github.com/6to5/acorn-6to5/archive/0384a0d51f630f66ed591769c1765581a17d2124.tar.gz",
|
||||
"acorn-6to5": "https://github.com/6to5/acorn-6to5/archive/a6c34ba73e215bd16ee585f6794f6a6587820c58.tar.gz",
|
||||
"estraverse": "^1.7.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -2,3 +2,5 @@
|
||||
/**/
|
||||
/*
|
||||
*/
|
||||
|
||||
test
|
||||
@@ -20,8 +20,11 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
function test() {}
|
||||
|
||||
|
||||
|
||||
// Copyright (C) 2012 Yusuke Suzuki <utatane.tea@gmail.com>
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
function add() {
|
||||
var _arguments = arguments;
|
||||
|
||||
return [1, 2, 3].map(function (i) {
|
||||
return i * _arguments[0];
|
||||
});
|
||||
|
||||
@@ -2,13 +2,10 @@
|
||||
|
||||
var seattlers = (function () {
|
||||
var _arr = [];
|
||||
|
||||
for (var _iterator = countries[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) {
|
||||
var customers = _step.value;
|
||||
|
||||
for (var _iterator2 = customers[Symbol.iterator](), _step2; !(_step2 = _iterator2.next()).done;) {
|
||||
var c = _step2.value;
|
||||
|
||||
if (c.city == "Seattle") {
|
||||
_arr.push({ name: c.name, age: c.age });
|
||||
}
|
||||
|
||||
@@ -2,10 +2,8 @@
|
||||
|
||||
var arr = (function () {
|
||||
var _arr = [];
|
||||
|
||||
for (var _iterator = "abcdefgh".split("")[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) {
|
||||
var x = _step.value;
|
||||
|
||||
for (var _iterator2 = "12345678".split("")[Symbol.iterator](), _step2; !(_step2 = _iterator2.next()).done;) {
|
||||
var y = _step2.value;
|
||||
_arr.push(x + y);
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
function add() {
|
||||
var _this = this;
|
||||
|
||||
return [1, 2, 3].map(function (i) {
|
||||
return i * _this.multiplier;
|
||||
});
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
function one() {
|
||||
var _arguments = arguments;
|
||||
|
||||
var inner = function () {
|
||||
return _arguments;
|
||||
};
|
||||
@@ -12,14 +11,12 @@ one(1, 2);
|
||||
|
||||
function two() {
|
||||
var _arguments2 = arguments;
|
||||
|
||||
var inner = function () {
|
||||
return _arguments2;
|
||||
};
|
||||
|
||||
var another = function () {
|
||||
var _arguments3 = arguments;
|
||||
|
||||
var inner2 = function () {
|
||||
return _arguments3;
|
||||
};
|
||||
@@ -31,7 +28,6 @@ two(1, 2);
|
||||
|
||||
function three() {
|
||||
var _arguments4 = arguments;
|
||||
|
||||
var fn = function () {
|
||||
return _arguments4[0] + "bar";
|
||||
};
|
||||
@@ -41,7 +37,6 @@ three("foo");
|
||||
|
||||
function four() {
|
||||
var _arguments5 = arguments;
|
||||
|
||||
var fn = function () {
|
||||
return _arguments5[0].foo + "bar";
|
||||
};
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
var some = function (count) {
|
||||
if (count === undefined) count = "30";
|
||||
|
||||
console.log("count", count);
|
||||
};
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
module.exports = {
|
||||
init: function () {
|
||||
var _this = this;
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
MongoClient.connect(config.mongodb, function (err, db) {
|
||||
if (err) {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
var _classProps = function (child, staticProps, instanceProps) {
|
||||
if (staticProps) Object.defineProperties(child, staticProps);
|
||||
|
||||
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
|
||||
};
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
var _classProps = function (child, staticProps, instanceProps) {
|
||||
if (staticProps) Object.defineProperties(child, staticProps);
|
||||
|
||||
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
|
||||
};
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
var _classProps = function (child, staticProps, instanceProps) {
|
||||
if (staticProps) Object.defineProperties(child, staticProps);
|
||||
|
||||
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
|
||||
};
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
var _classProps = function (child, staticProps, instanceProps) {
|
||||
if (staticProps) Object.defineProperties(child, staticProps);
|
||||
|
||||
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
|
||||
};
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
var _classProps = function (child, staticProps, instanceProps) {
|
||||
if (staticProps) Object.defineProperties(child, staticProps);
|
||||
|
||||
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
|
||||
};
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
var _classProps = function (child, staticProps, instanceProps) {
|
||||
if (staticProps) Object.defineProperties(child, staticProps);
|
||||
|
||||
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
|
||||
};
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
var _classProps = function (child, staticProps, instanceProps) {
|
||||
if (staticProps) Object.defineProperties(child, staticProps);
|
||||
|
||||
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
|
||||
};
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
var _classProps = function (child, staticProps, instanceProps) {
|
||||
if (staticProps) Object.defineProperties(child, staticProps);
|
||||
|
||||
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
|
||||
};
|
||||
|
||||
|
||||
@@ -2,14 +2,11 @@
|
||||
|
||||
var t = function (t, f) {
|
||||
if (f === undefined) f = 5;
|
||||
|
||||
if (t === undefined) t = "foo";
|
||||
|
||||
return t + " bar " + f;
|
||||
};
|
||||
|
||||
var a = function (t, f) {
|
||||
if (f === undefined) f = 5;
|
||||
|
||||
return t + " bar " + f;
|
||||
};
|
||||
|
||||
@@ -2,6 +2,5 @@
|
||||
|
||||
var t = function (t) {
|
||||
if (t === undefined) t = "foo";
|
||||
|
||||
return t + " bar";
|
||||
};
|
||||
|
||||
@@ -3,6 +3,5 @@
|
||||
for (var _ref in obj) {
|
||||
var name = _ref[0];
|
||||
var value = _ref[1];
|
||||
|
||||
print("Name: " + name + ", Value: " + value);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ function somethingAdvanced(_ref) {
|
||||
function unpackObject(_ref2) {
|
||||
var title = _ref2.title;
|
||||
var author = _ref2.author;
|
||||
|
||||
return title + " " + author;
|
||||
}
|
||||
|
||||
@@ -23,7 +22,6 @@ var unpackArray = function (_ref3, _ref4) {
|
||||
var x = _ref4[0];
|
||||
var y = _ref4[1];
|
||||
var z = _ref4[2];
|
||||
|
||||
return a + b + c;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
var Component;
|
||||
Component = React.createClass({
|
||||
displayName: "Component",
|
||||
|
||||
render: function () {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
exports = {
|
||||
Component: React.createClass({
|
||||
displayName: "Component",
|
||||
|
||||
render: function () {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
exports.Component = React.createClass({
|
||||
displayName: "Component",
|
||||
|
||||
render: function () {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
var Component = React.createClass({
|
||||
displayName: "Component",
|
||||
|
||||
render: function () {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
var _classProps = function (child, staticProps, instanceProps) {
|
||||
if (staticProps) Object.defineProperties(child, staticProps);
|
||||
|
||||
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
|
||||
};
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"column": 10
|
||||
},
|
||||
"generated": {
|
||||
"line": 15,
|
||||
"line": 14,
|
||||
"column": 15
|
||||
}
|
||||
}]
|
||||
|
||||
Reference in New Issue
Block a user