Compare commits

...

9 Commits

Author SHA1 Message Date
Sebastian McKenzie
751ea7a12c v1.12.7 2014-11-13 13:19:45 +11:00
Sebastian McKenzie
b30cd227cc update acorn-6to5 - fixes #153 2014-11-13 13:18:59 +11:00
Sebastian McKenzie
18dc7b8143 v1.12.6 2014-11-13 12:55:39 +11:00
Sebastian McKenzie
1c628bbec1 disable generation/comments/comment-only test 2014-11-13 12:53:38 +11:00
Sebastian McKenzie
d4c3dde02a update to latest acorn-6to5 2014-11-13 12:49:29 +11:00
Sebastian McKenzie
a587106a6b v1.12.5 2014-11-13 12:26:16 +11:00
Sebastian McKenzie
9c1b60e451 fix excessive whitespace trimming resulting in innaccurate sourcemap line - fixes #151 2014-11-13 12:25:11 +11:00
Sebastian McKenzie
0c7e0b65b9 add browser support, array comprehension, async functions and generator comprehension to differences table 2014-11-13 03:24:45 +11:00
Sebastian McKenzie
5c17091db4 replace documentation link 2014-11-13 01:17:14 +11:00
34 changed files with 29 additions and 42 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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": {

View File

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

View File

@@ -2,7 +2,6 @@
function add() {
var _arguments = arguments;
return [1, 2, 3].map(function (i) {
return i * _arguments[0];
});

View File

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

View File

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

View File

@@ -2,7 +2,6 @@
function add() {
var _this = this;
return [1, 2, 3].map(function (i) {
return i * _this.multiplier;
});

View File

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

View File

@@ -2,7 +2,6 @@
var some = function (count) {
if (count === undefined) count = "30";
console.log("count", count);
};

View File

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

View File

@@ -2,7 +2,6 @@
var _classProps = function (child, staticProps, instanceProps) {
if (staticProps) Object.defineProperties(child, staticProps);
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
};

View File

@@ -2,7 +2,6 @@
var _classProps = function (child, staticProps, instanceProps) {
if (staticProps) Object.defineProperties(child, staticProps);
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
};

View File

@@ -2,7 +2,6 @@
var _classProps = function (child, staticProps, instanceProps) {
if (staticProps) Object.defineProperties(child, staticProps);
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
};

View File

@@ -2,7 +2,6 @@
var _classProps = function (child, staticProps, instanceProps) {
if (staticProps) Object.defineProperties(child, staticProps);
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
};

View File

@@ -2,7 +2,6 @@
var _classProps = function (child, staticProps, instanceProps) {
if (staticProps) Object.defineProperties(child, staticProps);
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
};

View File

@@ -2,7 +2,6 @@
var _classProps = function (child, staticProps, instanceProps) {
if (staticProps) Object.defineProperties(child, staticProps);
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
};

View File

@@ -2,7 +2,6 @@
var _classProps = function (child, staticProps, instanceProps) {
if (staticProps) Object.defineProperties(child, staticProps);
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
};

View File

@@ -2,7 +2,6 @@
var _classProps = function (child, staticProps, instanceProps) {
if (staticProps) Object.defineProperties(child, staticProps);
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
};

View File

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

View File

@@ -2,6 +2,5 @@
var t = function (t) {
if (t === undefined) t = "foo";
return t + " bar";
};

View File

@@ -3,6 +3,5 @@
for (var _ref in obj) {
var name = _ref[0];
var value = _ref[1];
print("Name: " + name + ", Value: " + value);
}

View File

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

View File

@@ -1,7 +1,6 @@
var Component;
Component = React.createClass({
displayName: "Component",
render: function () {
return null;
}

View File

@@ -1,7 +1,6 @@
exports = {
Component: React.createClass({
displayName: "Component",
render: function () {
return null;
}

View File

@@ -1,6 +1,5 @@
exports.Component = React.createClass({
displayName: "Component",
render: function () {
return null;
}

View File

@@ -1,6 +1,5 @@
var Component = React.createClass({
displayName: "Component",
render: function () {
return null;
}

View File

@@ -2,7 +2,6 @@
var _classProps = function (child, staticProps, instanceProps) {
if (staticProps) Object.defineProperties(child, staticProps);
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
};

View File

@@ -4,7 +4,7 @@
"column": 10
},
"generated": {
"line": 15,
"line": 14,
"column": 15
}
}]