Compare commits

...

4 Commits

Author SHA1 Message Date
Sebastian McKenzie
7736fa11f2 v2.7.2 2015-01-07 18:38:00 +11:00
Sebastian McKenzie
d203924541 disable module import reassignment tests 2015-01-07 18:35:36 +11:00
Sebastian McKenzie
cd23e500a1 add back specNoForInOfAssignment transformer 2015-01-07 18:30:48 +11:00
Sebastian McKenzie
bf24a0d6b5 temporarily disable module collission detections 2015-01-07 18:30:33 +11:00
27 changed files with 29 additions and 5 deletions

View File

@@ -13,7 +13,7 @@ function DefaultFormatter(file) {
this.remapAssignments();
this.checkCollisions();
//this.checkCollisions();
}
DefaultFormatter.prototype.getLocalExports = function () {

View File

@@ -39,6 +39,8 @@ transform.moduleFormatters = {
};
_.each({
specNoForInOfAssignment: require("./transformers/spec-no-for-in-of-assignment"),
// playground
methodBinding: require("./transformers/playground-method-binding"),
memoizationOperator: require("./transformers/playground-memoization-operator"),

View File

@@ -0,0 +1,10 @@
var t = require("../../types");
exports.ForInStatement =
exports.ForOfStatement = function (node, parent, file) {
var left = node.left;
if (t.isVariableDeclaration(left)) {
var declar = left.declarations[0];
if (declar.init) throw file.errorWithNode(declar, "No assignments allowed in for-in/of head");
}
};

View File

@@ -146,10 +146,10 @@ exports.template = function (name, nodes, keepExpression) {
var node = template.body[0];
if (!keepExpression && t.isExpressionStatement(node)) {
node = node.expression;
return node.expression;
} else {
return node;
}
return node;
};
exports.codeFrame = function (lines, lineNumber, colNumber) {

View File

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

View File

@@ -0,0 +1,3 @@
for (var i = 0 in obj) {
}

View File

@@ -0,0 +1,3 @@
{
"throws": "No assignments allowed in for-in/of head"
}

View File

@@ -0,0 +1,3 @@
for (var i = 0 of obj) {
}

View File

@@ -0,0 +1,3 @@
{
"throws": "No assignments allowed in for-in/of head"
}