diff --git a/lib/6to5/transformation/modules/_default.js b/lib/6to5/transformation/modules/_default.js index 83cd732ca0..9a44d57791 100644 --- a/lib/6to5/transformation/modules/_default.js +++ b/lib/6to5/transformation/modules/_default.js @@ -212,9 +212,6 @@ DefaultFormatter.prototype.checkExportIdentifier = function (node) { }; DefaultFormatter.prototype.exportSpecifier = function (specifier, node, nodes) { - var inherits = false; - if (node.specifiers.length === 1) inherits = node; - if (node.source) { var ref = this.getExternalReference(node, nodes); diff --git a/lib/6to5/transformation/transformers/es6/classes.js b/lib/6to5/transformation/transformers/es6/classes.js index 5cdf30ceea..de547859f3 100644 --- a/lib/6to5/transformation/transformers/es6/classes.js +++ b/lib/6to5/transformation/transformers/es6/classes.js @@ -35,7 +35,7 @@ exports.ClassExpression = function (node, parent, scope, file) { * @param {Node} node * @param {File} file * @param {Scope} scope - * @param {Boolean} closure + * @param {Boolean} isStatement */ function ClassTransformer(node, file, scope, isStatement) { @@ -99,8 +99,7 @@ ClassTransformer.prototype.run = function () { closureArgs.push(superName); if (!t.isIdentifier(superName)) { - var superRef = this.scope.generateUidBasedOnNode(superName, this.file); - superName = superRef; + superName = this.scope.generateUidBasedOnNode(superName, this.file); } closureParams.push(superName); @@ -207,7 +206,7 @@ ClassTransformer.prototype.buildBody = function () { }; /** - * Push a method to it's respective mutatorMap. + * Push a method to its respective mutatorMap. * * @param {Node} node MethodDefinition */ diff --git a/lib/6to5/transformation/transformers/es6/for-of.js b/lib/6to5/transformation/transformers/es6/for-of.js index 42125650b0..14140334b7 100644 --- a/lib/6to5/transformation/transformers/es6/for-of.js +++ b/lib/6to5/transformation/transformers/es6/for-of.js @@ -18,7 +18,7 @@ exports.ForOfStatement = function (node, parent, scope, file) { // inherit comments from the original loop t.inheritsComments(loop, node); - // ensure that it's a block so we can take all it's statemetns + // ensure that it's a block so we can take all its statements t.ensureBlock(node); // add the value declaration to the new loop body diff --git a/lib/6to5/transformation/transformers/minification/dead-code-elimination.js b/lib/6to5/transformation/transformers/minification/dead-code-elimination.js index 6a7fdb8a57..f1f1a45fe6 100644 --- a/lib/6to5/transformation/transformers/minification/dead-code-elimination.js +++ b/lib/6to5/transformation/transformers/minification/dead-code-elimination.js @@ -3,7 +3,7 @@ var t = require("../../../types"); exports.optional = true; exports.ExpressionStatement = function (node) { - // remove consequenceless expressions such as local variables and literals + // remove consequence-less expressions such as local variables and literals // note: will remove directives // // var foo = true; foo; -> var foo = true; @@ -34,7 +34,7 @@ exports.IfStatement = { // if (t.isLiteral(test) && test.value) { - return alternate; + return consequent; } // we can check if a test will be falsy 100% and if so we can inline the diff --git a/lib/6to5/types/index.js b/lib/6to5/types/index.js index 55da05b75b..b587d58147 100644 --- a/lib/6to5/types/index.js +++ b/lib/6to5/types/index.js @@ -403,7 +403,7 @@ t.toIdentifier = function (name) { * Description * * @param {Object} node - * @param {String} key + * @param {String=} key */ t.ensureBlock = function (node, key) { @@ -418,7 +418,7 @@ t.ensureBlock = function (node, key) { * For example, given the match `React.createClass` it would match the * parsed nodes of `React.createClass` and `React["createClass"]`. * - * @param {String} match Dot delimetered string + * @param {String} match Dot-delimited string * @param {Boolean} [allowPartial] Allow a partial match * @returns {Function} */