From 146835e0f145d9dbadcdb9e192a2c96277bf2e3b Mon Sep 17 00:00:00 2001 From: chico Date: Tue, 10 Feb 2015 18:16:54 +0300 Subject: [PATCH] fix broken code, lint and codestyle fixes --- lib/6to5/transformation/transformers/es6/tail-call.js | 11 +++++------ lib/6to5/traversal/scope.js | 1 - lib/6to5/types/index.js | 1 - 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/6to5/transformation/transformers/es6/tail-call.js b/lib/6to5/transformation/transformers/es6/tail-call.js index cd04cf39e1..b40757edf9 100644 --- a/lib/6to5/transformation/transformers/es6/tail-call.js +++ b/lib/6to5/transformation/transformers/es6/tail-call.js @@ -2,7 +2,6 @@ var util = require("../../../util"); var t = require("../../../types"); -var _ = require("lodash"); var map = require("lodash/collection/map"); var flatten = require("lodash/array/flatten"); var reduceRight = require("lodash/collection/reduceRight"); @@ -86,11 +85,11 @@ TailCallTransformer.prototype.run = function () { var body = t.ensureBlock(node).body; if (this.vars.length > 0) { - var declarations = flatten(map(this.vars, function(decl) { - return decl.declaration; - })); - var statement = reduceRight(declarations, function(expr, decl) { - return t.assignmentExpression("=", decl.id, expr) + var declarations = flatten(map(this.vars, function (decl) { + return decl.declarations; + }, this)); + var statement = reduceRight(declarations, function (expr, decl) { + return t.assignmentExpression("=", decl.id, expr); }, t.identifier("undefined")); body.unshift(t.expressionStatement(statement)); } diff --git a/lib/6to5/traversal/scope.js b/lib/6to5/traversal/scope.js index 374b4ce798..9a26283954 100644 --- a/lib/6to5/traversal/scope.js +++ b/lib/6to5/traversal/scope.js @@ -317,7 +317,6 @@ var blockVariableVisitor = { }; Scope.prototype.crawl = function () { - var parent = this.parent; var block = this.block; var i; diff --git a/lib/6to5/types/index.js b/lib/6to5/types/index.js index 63a59db517..6e21d7c50f 100644 --- a/lib/6to5/types/index.js +++ b/lib/6to5/types/index.js @@ -1,7 +1,6 @@ "use strict"; var toFastProperties = require("../helpers/to-fast-properties"); -var defaults = require("lodash/object/defaults"); var isString = require("lodash/lang/isString"); var compact = require("lodash/array/compact"); var esutils = require("esutils");