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

acorn-globals

Package Overview
Dependencies
Maintainers
2
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

acorn-globals - npm Package Compare versions

Comparing version 2.0.0 to 3.0.0

32

index.js

@@ -22,17 +22,7 @@ 'use strict';

function reallyParse(source) {
try {
return acorn.parse(source, {
ecmaVersion: 6,
allowReturnOutsideFunction: true,
allowImportExportEverywhere: true,
allowHashBang: true
});
} catch (ex) {
return acorn.parse(source, {
ecmaVersion: 5,
allowReturnOutsideFunction: true,
allowImportExportEverywhere: true,
allowHashBang: true
});
}
return acorn.parse(source, {
allowReturnOutsideFunction: true,
allowImportExportEverywhere: true,
allowHashBang: true
});
}

@@ -131,4 +121,4 @@ module.exports = findGlobals;

if (node.handler === null) return;
node.handler.body.locals = node.handler.body.locals || {};
node.handler.body.locals[node.handler.param.name] = true;
node.handler.locals = node.handler.locals || {};
node.handler.locals[node.handler.param.name] = true;
},

@@ -150,10 +140,2 @@ 'ImportDefaultSpecifier': declareModuleSpecifier,

}
if (
parents[parents.length - 2] &&
parents[parents.length - 2].type === 'TryStatement' &&
parents[parents.length - 2].handler &&
node === parents[parents.length - 2].handler.param
) {
return;
}
node.parents = parents;

@@ -160,0 +142,0 @@ globals.push(node);

{
"name": "acorn-globals",
"version": "2.0.0",
"version": "3.0.0",
"description": "Detect global variables in JavaScript using acorn",

@@ -20,3 +20,3 @@ "keywords": [

"dependencies": {
"acorn": "^2.1.0"
"acorn": "^3.1.0"
},

@@ -23,0 +23,0 @@ "devDependencies": {

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