Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

systemjs-builder

Package Overview
Dependencies
Maintainers
1
Versions
139
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

systemjs-builder - npm Package Compare versions

Comparing version 0.5.1 to 0.5.2

test/global-inner.js

32

compilers/global.js

@@ -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');

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc