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

babel-plugin-minify-mangle-names

Package Overview
Dependencies
Maintainers
5
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-minify-mangle-names - npm Package Compare versions

Comparing version 0.5.0-alpha.8b905991 to 0.5.0-alpha.91ed3622

27

lib/index.js

@@ -137,3 +137,7 @@ "use strict";

Object.keys(scope.bindings).forEach(name => {
scopeTracker.addBinding(scope.bindings[name]);
scopeTracker.addBinding(scope.bindings[name]); // add all constant violations as references
scope.bindings[name].constantViolations.forEach(() => {
scopeTracker.addReference(scope, scope.bindings[name], name);
});
});

@@ -143,2 +147,23 @@ },

/**
* This is required because after function name transformation
* plugin (part of es2015), the function name is NOT added to the
* scope's bindings. So to fix this issue, we simply add a hack to
* handle that case - fix it to the scope tree.
*
* Related:
* - https://github.com/babel/minify/issues/829
*/
BindingIdentifier(path) {
if ( // the parent has this id as the name
(path.parentPath.isFunctionExpression({
id: path.node
}) || path.parentPath.isClassExpression({
id: path.node
})) && // and the id isn't yet added to the scope
!hop.call(path.parentPath.scope.bindings, path.node.name)) {
path.parentPath.scope.registerBinding("local", path.parentPath);
}
},
/**
* This is necessary because, in Babel, the scope.references

@@ -145,0 +170,0 @@ * does NOT contain the references in that scope. Only the program

4

package.json
{
"name": "babel-plugin-minify-mangle-names",
"version": "0.5.0-alpha.8b905991",
"version": "0.5.0-alpha.91ed3622",
"description": "",

@@ -15,4 +15,4 @@ "keywords": [

"dependencies": {
"babel-helper-mark-eval-scopes": "^0.5.0-alpha.8b905991"
"babel-helper-mark-eval-scopes": "^0.5.0-alpha.91ed3622"
}
}

@@ -34,3 +34,3 @@ # babel-plugin-minify-mangle-names

```sh
npm install babel-plugin-minify-mangle-names
npm install babel-plugin-minify-mangle-names --save-dev
```

@@ -37,0 +37,0 @@

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