remove unused variables
This commit is contained in:
parent
1a3d306949
commit
eefab7f80f
@ -3,6 +3,7 @@ module.exports = function (ast, opts) {
|
|||||||
return gen.generate(ast, opts);
|
return gen.generate(ast, opts);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var assert = require("assert");
|
||||||
var _ = require("lodash");
|
var _ = require("lodash");
|
||||||
|
|
||||||
function CodeGenerator() {
|
function CodeGenerator() {
|
||||||
@ -71,7 +72,7 @@ CodeGenerator.prototype.Program = function (node, print) {
|
|||||||
return print.sequence(node.body);
|
return print.sequence(node.body);
|
||||||
};
|
};
|
||||||
|
|
||||||
CodeGenerator.prototype.EmptyStatement = function (node, print) {
|
CodeGenerator.prototype.EmptyStatement = function () {
|
||||||
return "";
|
return "";
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -101,7 +102,7 @@ CodeGenerator.prototype.Path = function (node, print) {
|
|||||||
return "." + print(node.body);
|
return "." + print(node.body);
|
||||||
};
|
};
|
||||||
|
|
||||||
CodeGenerator.prototype.Identifier = function (node, print) {
|
CodeGenerator.prototype.Identifier = function (node) {
|
||||||
return node.name;
|
return node.name;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -137,7 +138,7 @@ CodeGenerator.prototype.ArrowFunctionExpression = function (node, print) {
|
|||||||
return code;
|
return code;
|
||||||
};
|
};
|
||||||
|
|
||||||
CodeGenerator.prototype.MethodDefinition = function (node, print) {
|
CodeGenerator.prototype.MethodDefinition = function () {
|
||||||
throw new Error("MethodDefinition");
|
throw new Error("MethodDefinition");
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -172,15 +173,15 @@ CodeGenerator.prototype.ExportSpecifier = function (node, print) {
|
|||||||
return code;
|
return code;
|
||||||
};
|
};
|
||||||
|
|
||||||
CodeGenerator.prototype.ExportBatchSpecifier = function (node, print) {
|
CodeGenerator.prototype.ExportBatchSpecifier = function () {
|
||||||
return "*";
|
return "*";
|
||||||
};
|
};
|
||||||
|
|
||||||
CodeGenerator.prototype.ExportDeclaration = function (node, print) {
|
CodeGenerator.prototype.ExportDeclaration = function () {
|
||||||
throw new Error("ExportDeclaration");
|
throw new Error("ExportDeclaration");
|
||||||
};
|
};
|
||||||
|
|
||||||
CodeGenerator.prototype.ImportDeclaration = function (node, print) {
|
CodeGenerator.prototype.ImportDeclaration = function () {
|
||||||
throw new Error("ImportDeclaration");
|
throw new Error("ImportDeclaration");
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -292,11 +293,11 @@ CodeGenerator.prototype.SequenceExpression = function (node, print) {
|
|||||||
return node.expressions.map(print).join(", ");
|
return node.expressions.map(print).join(", ");
|
||||||
};
|
};
|
||||||
|
|
||||||
CodeGenerator.prototype.ThisExpression = function (node, print) {
|
CodeGenerator.prototype.ThisExpression = function () {
|
||||||
return "this";
|
return "this";
|
||||||
};
|
};
|
||||||
|
|
||||||
CodeGenerator.prototype.Literal = function (node, print) {
|
CodeGenerator.prototype.Literal = function (node) {
|
||||||
var val = node.value;
|
var val = node.value;
|
||||||
var type = typeof val;
|
var type = typeof val;
|
||||||
|
|
||||||
@ -317,7 +318,7 @@ CodeGenerator.prototype.Literal = function (node, print) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
CodeGenerator.prototype.ModuleSpecifier = function (node, print) {
|
CodeGenerator.prototype.ModuleSpecifier = function (node) {
|
||||||
return "\"" + node.value + "\"";
|
return "\"" + node.value + "\"";
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -505,7 +506,7 @@ CodeGenerator.prototype.SwitchCase = function (node, print) {
|
|||||||
return this.indent(code);
|
return this.indent(code);
|
||||||
};
|
};
|
||||||
|
|
||||||
CodeGenerator.prototype.DebuggerStatement = function (node, print) {
|
CodeGenerator.prototype.DebuggerStatement = function () {
|
||||||
return "debugger;";
|
return "debugger;";
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -582,7 +583,7 @@ CodeGenerator.prototype.XJSAttribute = function (node, print) {
|
|||||||
return code;
|
return code;
|
||||||
};
|
};
|
||||||
|
|
||||||
CodeGenerator.prototype.XJSIdentifier = function (node, print) {
|
CodeGenerator.prototype.XJSIdentifier = function (node) {
|
||||||
return node.name;
|
return node.name;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -602,7 +603,7 @@ CodeGenerator.prototype.XJSExpressionContainer = function (node, print) {
|
|||||||
return "{" + print(node.expression) + "}";
|
return "{" + print(node.expression) + "}";
|
||||||
};
|
};
|
||||||
|
|
||||||
CodeGenerator.prototype.XJSElement = function (node, print) {
|
CodeGenerator.prototype.XJSElement = function () {
|
||||||
throw new Error("XJSElement");
|
throw new Error("XJSElement");
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -615,14 +616,14 @@ CodeGenerator.prototype.XJSOpeningElement = function (node, print) {
|
|||||||
return code;
|
return code;
|
||||||
};
|
};
|
||||||
|
|
||||||
CodeGenerator.prototype.XJSClosingElement = function (node, print) {
|
CodeGenerator.prototype.XJSClosingElement = function (node) {
|
||||||
return "</" + node.name + ">";
|
return "</" + node.name + ">";
|
||||||
};
|
};
|
||||||
|
|
||||||
CodeGenerator.prototype.XJSText = function (node, print) {
|
CodeGenerator.prototype.XJSText = function (node) {
|
||||||
return node.value;
|
return node.value;
|
||||||
};
|
};
|
||||||
|
|
||||||
CodeGenerator.prototype.XJSEmptyExpression = function (node, print) {
|
CodeGenerator.prototype.XJSEmptyExpression = function () {
|
||||||
return "";
|
return "";
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user