remove dead code
This commit is contained in:
@@ -37,25 +37,23 @@ var buildClassBody = function (body, className, superName, node) {
|
||||
var mutatorMap = {};
|
||||
|
||||
var classBody = node.body.body;
|
||||
_.each(classBody, function (bodyNode) {
|
||||
if (bodyNode.type !== "MethodDefinition") return;
|
||||
|
||||
var methodName = bodyNode.key.name;
|
||||
var method = bodyNode.value;
|
||||
_.each(classBody, function (node) {
|
||||
var methodName = node.key.name;
|
||||
var method = node.value;
|
||||
|
||||
replaceInstanceSuperReferences(superName, method);
|
||||
|
||||
if (methodName === "constructor") {
|
||||
if (bodyNode.kind === "") {
|
||||
if (node.kind === "") {
|
||||
addConstructor(body[0], method);
|
||||
} else {
|
||||
throw new Error("unknown kind for constructor method");
|
||||
}
|
||||
} else {
|
||||
if (bodyNode.kind === "") {
|
||||
if (node.kind === "") {
|
||||
addInstanceMethod(body, className, methodName, method);
|
||||
} else {
|
||||
util.pushMutatorMap(mutatorMap, methodName, bodyNode.kind, bodyNode);
|
||||
util.pushMutatorMap(mutatorMap, methodName, node.kind, node);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -75,8 +75,6 @@ exports.ExportDeclaration = function (node) {
|
||||
KEY: declar.id,
|
||||
VALUE: declar
|
||||
}, true));
|
||||
} else {
|
||||
throw new Error("unsupported export declaration type " + declar.type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,18 +72,3 @@ traverse.replace = function (node, callback) {
|
||||
if (result != null) obj[key] = result;
|
||||
});
|
||||
};
|
||||
|
||||
traverse.replace.shallow = function (node, callback) {
|
||||
traverse(node, function (node, parent, obj, key) {
|
||||
var result = callback(node, parent);
|
||||
if (result != null) obj[key] = result;
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
traverse.shallow = function (node, callback) {
|
||||
traverse(node, function () {
|
||||
callback.apply(this, arguments);
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user