es6-module-transpiler-amd-formatter
Advanced tools
Comparing version 0.2.3 to 0.2.4
21
index.js
@@ -55,3 +55,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 | ||
@@ -64,3 +64,3 @@ * declarations alone. | ||
*/ | ||
AMDFormatter.prototype.processFunctionDeclaration = function(mod, nodePath) { | ||
AMDFormatter.prototype.processFunctionDeclaration = function(/* mod, nodePath */) { | ||
return null; | ||
@@ -70,2 +70,15 @@ }; | ||
/** | ||
* 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. | ||
* | ||
* @param {Module} mod | ||
* @param {ast-types.NodePath} nodePath | ||
* @returns {Array.<ast-types.Node>} | ||
*/ | ||
AMDFormatter.prototype.processClassDeclaration = function(/* mod, nodePath */) { | ||
return null; | ||
}; | ||
/** | ||
* Because exported references are captured via a closure as part of a getter | ||
@@ -168,4 +181,6 @@ * on the `exports` object, there's no need to rewrite local references to | ||
if (n.FunctionDeclaration.check(declaration)) { | ||
if (n.FunctionDeclaration.check(declaration) || | ||
n.ClassDeclaration.check(declaration)) { | ||
// export function <name> () {} | ||
// export class Foo {} | ||
return Replacement.swaps(nodePath, [declaration, b.expressionStatement( | ||
@@ -172,0 +187,0 @@ b.callExpression(b.identifier('__es6_export__'), [b.literal(declaration.id.name), declaration.id]) |
{ | ||
"name": "es6-module-transpiler-amd-formatter", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"description": "ES6 Module Transpiler Extension to Output AMD define() Format.", | ||
@@ -5,0 +5,0 @@ "author": "Caridy Patino <caridy@gmail.com>", |
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
20731
5
436