acorn-globals
Advanced tools
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": { |
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
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
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
6628
3
158
1
0
+ Addedacorn@3.3.0(transitive)
- Removedacorn@2.7.0(transitive)
Updatedacorn@^3.1.0