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

acorn-globals

Package Overview
Dependencies
Maintainers
3
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 6.0.0 to 7.0.0-canary-3

20

index.js

@@ -17,13 +17,11 @@ 'use strict';

function declaresThis(node) {
return node.type === 'FunctionExpression' || node.type === 'FunctionDeclaration';
}
function reallyParse(source, options) {
var parseOptions = Object.assign({}, options,
var parseOptions = Object.assign(
{
allowReturnOutsideFunction: true,
allowImportExportEverywhere: true,
allowHashBang: true
}
allowHashBang: true,
ecmaVersion: "latest"
},
options
);

@@ -136,3 +134,3 @@ return acorn.parse(source, parseOptions);

'TryStatement': function (node) {
if (node.handler === null) return;
if (node.handler === null || node.handler.param === null) return;
node.handler.locals = node.handler.locals || Object.create(null);

@@ -164,5 +162,5 @@ declarePattern(node.handler.param, node.handler);

for (var i = 0; i < parents.length; i++) {
if (declaresThis(parents[i])) {
return;
}
var parent = parents[i];
if ( parent.type === 'FunctionExpression' || parent.type === 'FunctionDeclaration' ) { return; }
if ( parent.type === 'PropertyDefinition' && parents[i+1]===parent.value ) { return; }
}

@@ -169,0 +167,0 @@ node.parents = parents.slice();

{
"name": "acorn-globals",
"version": "6.0.0",
"version": "7.0.0-canary-3",
"description": "Detect global variables in JavaScript using acorn",

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

"dependencies": {
"acorn": "^7.1.1",
"acorn-walk": "^7.1.1"
"acorn": "^8.1.0",
"acorn-walk": "^8.0.2"
},

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

@@ -7,5 +7,5 @@ # acorn-globals

[![Build Status](https://img.shields.io/travis/ForbesLindesay/acorn-globals/master.svg)](https://travis-ci.org/ForbesLindesay/acorn-globals)
[![Dependency Status](https://img.shields.io/david/ForbesLindesay/acorn-globals.svg)](https://david-dm.org/ForbesLindesay/acorn-globals)
[![NPM version](https://img.shields.io/npm/v/acorn-globals.svg)](https://www.npmjs.org/package/acorn-globals)
[![Build Status](https://img.shields.io/github/workflow/status/ForbesLindesay/acorn-globals/Publish%20Canary/master?style=for-the-badge)](https://github.com/ForbesLindesay/acorn-globals/actions?query=workflow%3APublish%20Canary+branch%3Amaster)
[![Rolling Versions](https://img.shields.io/badge/Rolling%20Versions-Enabled-brightgreen?style=for-the-badge)](https://rollingversions.com/ForbesLindesay/acorn-globals)
[![NPM version](https://img.shields.io/npm/v/acorn-globals?style=for-the-badge)](https://www.npmjs.com/package/acorn-globals)

@@ -12,0 +12,0 @@ ## Installation

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