es6-module-transpiler
Advanced tools
Comparing version 0.9.2 to 0.9.3
@@ -481,3 +481,3 @@ /* jshint node:true, undef:true, unused:true */ | ||
/** | ||
* Process a variable declaration found at the top level of the module. Since | ||
* Process a function declaration found at the top level of the module. Since | ||
* we do not need to rewrite exported functions, we can leave function | ||
@@ -493,2 +493,13 @@ * declarations alone. | ||
/** | ||
* Process a class declaration found at the top level of the module. Since | ||
* we do not need to rewrite exported classes, we can leave class | ||
* declarations alone. | ||
* | ||
* @override | ||
*/ | ||
CommonJSFormatter.prototype.processClassDeclaration = function(mod, nodePath) { | ||
return null; | ||
}; | ||
/** | ||
* Since import declarations only control how we rewrite references we can just | ||
@@ -495,0 +506,0 @@ * remove them -- they don't turn into any actual statements. |
@@ -116,3 +116,3 @@ /* jshint node:true, undef:true, unused:true */ | ||
/** | ||
* Process a variable declaration found at the top level of the module. | ||
* Process a function declaration found at the top level of the module. | ||
* | ||
@@ -128,2 +128,13 @@ * @param {Module} mod | ||
/** | ||
* Process a class declaration found at the top level of the module. | ||
* | ||
* @param {Module} mod | ||
* @param {NodePath} nodePath | ||
* @return {?Node[]} | ||
*/ | ||
Formatter.prototype.processClassDeclaration = function(mod, nodePath) { | ||
throw new Error('#processClassDeclaration must be implemented in subclasses'); | ||
}; | ||
/** | ||
* Process a variable declaration found at the top level of the module. | ||
@@ -130,0 +141,0 @@ * |
@@ -171,2 +171,19 @@ /* jshint node:true, undef:true, unused:true */ | ||
/** | ||
* Process all top-level class declarations in case they need to be processed. | ||
* | ||
* @param {NodePath} nodePath | ||
* @private | ||
*/ | ||
Rewriter.prototype.visitClassDeclaration = function(nodePath) { | ||
if (n.Program.check(nodePath.parent.node)) { | ||
var replacement = this.formatter.processClassDeclaration(this.currentModule, nodePath); | ||
if (replacement) { | ||
this.replacements.push(replacement); | ||
} | ||
} | ||
this.traverse(nodePath); | ||
}; | ||
/** | ||
* Look for all export declarations so we can rewrite them. | ||
@@ -173,0 +190,0 @@ * |
{ | ||
"name": "es6-module-transpiler", | ||
"version": "0.9.2", | ||
"version": "0.9.3", | ||
"description": "es6-module-transpiler is an experimental compiler that allows you to write your JavaScript using a subset of the current ES6 module syntax, and compile it into various formats.", | ||
@@ -59,2 +59,2 @@ "homepage": "http://esnext.github.io/es6-module-transpiler", | ||
} | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
117065
3622