From eefab7f80f75520fd5a01040b8af905e7cc51b4c Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Thu, 30 Oct 2014 13:31:45 +1100 Subject: [PATCH] remove unused variables --- lib/6to5/generator.js | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/lib/6to5/generator.js b/lib/6to5/generator.js index d5dcd5031e..a5241e4926 100644 --- a/lib/6to5/generator.js +++ b/lib/6to5/generator.js @@ -3,7 +3,8 @@ module.exports = function (ast, opts) { return gen.generate(ast, opts); }; -var _ = require("lodash"); +var assert = require("assert"); +var _ = require("lodash"); function CodeGenerator() { this.indent = this.indent.bind(this); @@ -71,7 +72,7 @@ CodeGenerator.prototype.Program = function (node, print) { return print.sequence(node.body); }; -CodeGenerator.prototype.EmptyStatement = function (node, print) { +CodeGenerator.prototype.EmptyStatement = function () { return ""; }; @@ -101,7 +102,7 @@ CodeGenerator.prototype.Path = function (node, print) { return "." + print(node.body); }; -CodeGenerator.prototype.Identifier = function (node, print) { +CodeGenerator.prototype.Identifier = function (node) { return node.name; }; @@ -137,7 +138,7 @@ CodeGenerator.prototype.ArrowFunctionExpression = function (node, print) { return code; }; -CodeGenerator.prototype.MethodDefinition = function (node, print) { +CodeGenerator.prototype.MethodDefinition = function () { throw new Error("MethodDefinition"); }; @@ -172,15 +173,15 @@ CodeGenerator.prototype.ExportSpecifier = function (node, print) { return code; }; -CodeGenerator.prototype.ExportBatchSpecifier = function (node, print) { +CodeGenerator.prototype.ExportBatchSpecifier = function () { return "*"; }; -CodeGenerator.prototype.ExportDeclaration = function (node, print) { +CodeGenerator.prototype.ExportDeclaration = function () { throw new Error("ExportDeclaration"); }; -CodeGenerator.prototype.ImportDeclaration = function (node, print) { +CodeGenerator.prototype.ImportDeclaration = function () { throw new Error("ImportDeclaration"); }; @@ -292,11 +293,11 @@ CodeGenerator.prototype.SequenceExpression = function (node, print) { return node.expressions.map(print).join(", "); }; -CodeGenerator.prototype.ThisExpression = function (node, print) { +CodeGenerator.prototype.ThisExpression = function () { return "this"; }; -CodeGenerator.prototype.Literal = function (node, print) { +CodeGenerator.prototype.Literal = function (node) { var val = node.value; 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 + "\""; }; @@ -505,7 +506,7 @@ CodeGenerator.prototype.SwitchCase = function (node, print) { return this.indent(code); }; -CodeGenerator.prototype.DebuggerStatement = function (node, print) { +CodeGenerator.prototype.DebuggerStatement = function () { return "debugger;"; }; @@ -582,7 +583,7 @@ CodeGenerator.prototype.XJSAttribute = function (node, print) { return code; }; -CodeGenerator.prototype.XJSIdentifier = function (node, print) { +CodeGenerator.prototype.XJSIdentifier = function (node) { return node.name; }; @@ -602,7 +603,7 @@ CodeGenerator.prototype.XJSExpressionContainer = function (node, print) { return "{" + print(node.expression) + "}"; }; -CodeGenerator.prototype.XJSElement = function (node, print) { +CodeGenerator.prototype.XJSElement = function () { throw new Error("XJSElement"); }; @@ -615,14 +616,14 @@ CodeGenerator.prototype.XJSOpeningElement = function (node, print) { return code; }; -CodeGenerator.prototype.XJSClosingElement = function (node, print) { +CodeGenerator.prototype.XJSClosingElement = function (node) { return ""; }; -CodeGenerator.prototype.XJSText = function (node, print) { +CodeGenerator.prototype.XJSText = function (node) { return node.value; }; -CodeGenerator.prototype.XJSEmptyExpression = function (node, print) { +CodeGenerator.prototype.XJSEmptyExpression = function () { return ""; };