systemjs-builder
Advanced tools
Comparing version 0.5.1 to 0.5.2
@@ -20,6 +20,11 @@ var traceur = require('traceur'); | ||
GlobalTransformer.prototype.transformVariableDeclarationList = function(tree) { | ||
this.isVarDeclaration = tree.declarationType == 'var'; | ||
return ParseTreeTransformer.prototype.transformVariableDeclarationList.call(this, tree); | ||
} | ||
GlobalTransformer.prototype.transformVariableDeclaration = function(tree) { | ||
tree = ParseTreeTransformer.prototype.transformVariableDeclaration.call(this, tree); | ||
if (!this.inOuterScope) | ||
if (!this.inOuterScope || !this.isVarDeclaration) | ||
return tree; | ||
@@ -31,15 +36,26 @@ | ||
} | ||
GlobalTransformer.prototype.enterScope = function() { | ||
var revert = this.inOuterScope; | ||
this.inOuterScope = false; | ||
return revert; | ||
} | ||
GlobalTransformer.prototype.exitScope = function(revert) { | ||
if (revert) | ||
this.inOuterScope = true; | ||
} | ||
GlobalTransformer.prototype.transformFunctionDeclaration = function(tree) { | ||
if (this.inOuterScope) | ||
var revertOuterScope = true; | ||
this.inOuterScope = false; | ||
var revert = this.enterScope(); | ||
tree = ParseTreeTransformer.prototype.transformFunctionDeclaration.call(this, tree); | ||
if (revertOuterScope) | ||
this.inOuterScope = true; | ||
this.exitScope(revert); | ||
return tree; | ||
} | ||
GlobalTransformer.prototype.transformFunctionExpression = function(tree) { | ||
var revert = this.enterScope(); | ||
tree = ParseTreeTransformer.prototype.transformFunctionExpression.call(this, tree); | ||
this.exitScope(revert); | ||
return tree; | ||
} | ||
GlobalTransformer.prototype.transformScript = function(tree) { | ||
@@ -46,0 +62,0 @@ tree = ParseTreeTransformer.prototype.transformScript.call(this, tree); |
{ | ||
"name": "systemjs-builder", | ||
"version": "0.5.1", | ||
"version": "0.5.2", | ||
"description": "SystemJS Build Tool ===", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -36,4 +36,15 @@ var builder = require('../index'); | ||
.then(function() { | ||
return builder.trace('tree/global-inner').then(function(trace) { | ||
return builder.buildTree(trace.tree, 'global-inner.js'); | ||
}); | ||
}) | ||
.then(function() { | ||
return builder.trace('tree/global-outer').then(function(trace) { | ||
return builder.buildTree(trace.tree, 'global-outer.js'); | ||
}); | ||
}) | ||
.then(function() { | ||
return builder.trace('tree/amd-1').then(function(trace) { | ||
@@ -40,0 +51,0 @@ return builder.buildTree(builder.subtractTrees(trace.tree, treeFirst), 'amd-1.js'); |
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
93660
58
2306