remove specBlockHoistFunctions and specNoForInOfAssignment
This commit is contained in:
parent
fd1a91bf9c
commit
2c471968ea
@ -39,10 +39,6 @@ transform.moduleFormatters = {
|
||||
};
|
||||
|
||||
_.each({
|
||||
// spec
|
||||
specBlockHoistFunctions: require("./transformers/spec-block-hoist-functions"),
|
||||
specNoForInOfAssignment: require("./transformers/spec-no-for-in-of-assignment"),
|
||||
|
||||
// playground
|
||||
methodBinding: require("./transformers/playground-method-binding"),
|
||||
memoizationOperator: require("./transformers/playground-memoization-operator"),
|
||||
|
||||
@ -1,18 +0,0 @@
|
||||
var t = require("../../types");
|
||||
|
||||
exports.BlockStatement = function (node, parent) {
|
||||
if (t.isFunction(parent)) return;
|
||||
|
||||
node.body = node.body.map(function (node) {
|
||||
if (t.isFunction(node)) {
|
||||
node.type = "FunctionExpression";
|
||||
var declar = t.variableDeclaration("let", [
|
||||
t.variableDeclarator(node.id, node)
|
||||
]);
|
||||
declar._blockHoist = true;
|
||||
return declar;
|
||||
} else {
|
||||
return node;
|
||||
}
|
||||
});
|
||||
};
|
||||
@ -1,10 +0,0 @@
|
||||
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");
|
||||
}
|
||||
};
|
||||
Loading…
x
Reference in New Issue
Block a user