acorn-globals
Advanced tools
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 |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
9373
173
2
1
+ Addedacorn@8.14.0(transitive)
+ Addedacorn-walk@8.3.4(transitive)
- Removedacorn@7.4.1(transitive)
- Removedacorn-walk@7.2.0(transitive)
Updatedacorn@^8.1.0
Updatedacorn-walk@^8.0.2