From 98d555498d2866c7324ee9cfa3dff1e236de2a55 Mon Sep 17 00:00:00 2001 From: Brian Donovan Date: Thu, 12 Feb 2015 18:29:14 -0800 Subject: [PATCH 1/9] Remove unused variable. --- lib/6to5/transformation/modules/_default.js | 3 --- 1 file changed, 3 deletions(-) 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); From 83b4d128846080acdeb39b9a2e3c3b17f33689f3 Mon Sep 17 00:00:00 2001 From: Brian Donovan Date: Thu, 12 Feb 2015 18:35:35 -0800 Subject: [PATCH 2/9] Correct a jsdoc comment parameter name. --- lib/6to5/transformation/transformers/es6/classes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/6to5/transformation/transformers/es6/classes.js b/lib/6to5/transformation/transformers/es6/classes.js index 5cdf30ceea..4a6bf90b4f 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) { From 0b042b26810ae557f91fddc01caff56790f26530 Mon Sep 17 00:00:00 2001 From: Brian Donovan Date: Thu, 12 Feb 2015 18:36:02 -0800 Subject: [PATCH 3/9] Use the posessive form of "its", not a contraction of "it is". --- lib/6to5/transformation/transformers/es6/classes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/6to5/transformation/transformers/es6/classes.js b/lib/6to5/transformation/transformers/es6/classes.js index 4a6bf90b4f..5388489bdb 100644 --- a/lib/6to5/transformation/transformers/es6/classes.js +++ b/lib/6to5/transformation/transformers/es6/classes.js @@ -207,7 +207,7 @@ ClassTransformer.prototype.buildBody = function () { }; /** - * Push a method to it's respective mutatorMap. + * Push a method to its respective mutatorMap. * * @param {Node} node MethodDefinition */ From 9ec9e13aeb8a0adedbabc6f7858a1a55b41f1cfc Mon Sep 17 00:00:00 2001 From: Brian Donovan Date: Thu, 12 Feb 2015 18:36:36 -0800 Subject: [PATCH 4/9] Update the jsdoc to indicate that `key` is optional. --- lib/6to5/types/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/6to5/types/index.js b/lib/6to5/types/index.js index 55da05b75b..ef652e2008 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) { From f5bae0b696eb6881d46d158a1dfab31b7be1d508 Mon Sep 17 00:00:00 2001 From: Brian Donovan Date: Thu, 12 Feb 2015 18:46:53 -0800 Subject: [PATCH 5/9] Remove redundant variable. --- lib/6to5/transformation/transformers/es6/classes.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/6to5/transformation/transformers/es6/classes.js b/lib/6to5/transformation/transformers/es6/classes.js index 5388489bdb..de547859f3 100644 --- a/lib/6to5/transformation/transformers/es6/classes.js +++ b/lib/6to5/transformation/transformers/es6/classes.js @@ -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); From ea471a6a17d2e5f1061067023b6a007cf99df0e4 Mon Sep 17 00:00:00 2001 From: Brian Donovan Date: Thu, 12 Feb 2015 18:47:08 -0800 Subject: [PATCH 6/9] Fix a few typos. --- lib/6to5/transformation/transformers/es6/for-of.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From a212f035e43550a59793804bf7e2b21835fafada Mon Sep 17 00:00:00 2001 From: Brian Donovan Date: Thu, 12 Feb 2015 19:06:06 -0800 Subject: [PATCH 7/9] Return the consequent if the test is truthy. --- .../transformers/minification/dead-code-elimination.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/6to5/transformation/transformers/minification/dead-code-elimination.js b/lib/6to5/transformation/transformers/minification/dead-code-elimination.js index eb94292989..5004f5145d 100644 --- a/lib/6to5/transformation/transformers/minification/dead-code-elimination.js +++ b/lib/6to5/transformation/transformers/minification/dead-code-elimination.js @@ -33,7 +33,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 From 49904b3ab3bd940deafe3c868bbab4464935c611 Mon Sep 17 00:00:00 2001 From: Brian Donovan Date: Thu, 12 Feb 2015 19:07:54 -0800 Subject: [PATCH 8/9] Fix a small grammar issue. --- .../transformers/minification/dead-code-elimination.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/6to5/transformation/transformers/minification/dead-code-elimination.js b/lib/6to5/transformation/transformers/minification/dead-code-elimination.js index eb94292989..64fe5911fd 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 // // var foo = true; foo; -> var foo = true; // "foo"; -> From 14267a788d384726f9bc614caf6581a9ee5781c0 Mon Sep 17 00:00:00 2001 From: Brian Donovan Date: Thu, 12 Feb 2015 19:11:47 -0800 Subject: [PATCH 9/9] Fix a typo. --- lib/6to5/types/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/6to5/types/index.js b/lib/6to5/types/index.js index ef652e2008..b587d58147 100644 --- a/lib/6to5/types/index.js +++ b/lib/6to5/types/index.js @@ -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} */