Merge branch 'master' of github.com:6to5/6to5
Conflicts: lib/6to5/transformation/transformers/minification/dead-code-elimination.js
This commit is contained in:
commit
2d8581c6dc
@ -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);
|
||||
|
||||
|
||||
@ -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
|
||||
*/
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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}
|
||||
*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user