Socket
Socket
Sign inDemoInstall

@babel/traverse

Package Overview
Dependencies
Maintainers
4
Versions
180
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/traverse - npm Package Compare versions

Comparing version 7.20.8 to 7.20.10

34

lib/path/introspection.js

@@ -163,3 +163,3 @@ "use strict";

function getOuterFunction(path) {
return (path.parentPath.scope.getFunctionParent() || path.parentPath.scope.getProgramParent()).path;
return path.isProgram() ? path : (path.parentPath.scope.getFunctionParent() || path.parentPath.scope.getProgramParent()).path;
}

@@ -212,2 +212,4 @@ function isExecutionUncertain(type, key) {

const SYMBOL_CHECKING = Symbol();
function _guessExecutionStatusRelativeTo(target) {

@@ -269,7 +271,5 @@ return _guessExecutionStatusRelativeToCached(this, target, new Map());

}
const executionOrderCheckedNodes = new Set();
function _guessExecutionStatusRelativeToDifferentFunctionsInternal(base, target, cache) {
if (!target.isFunctionDeclaration()) {
if (base._guessExecutionStatusRelativeTo(target) === "before") {
if (_guessExecutionStatusRelativeToCached(base, target, cache) === "before") {
return "before";

@@ -294,14 +294,7 @@ }

}
if (executionOrderCheckedNodes.has(path.node)) continue;
executionOrderCheckedNodes.add(path.node);
try {
const status = _guessExecutionStatusRelativeToCached(base, path, cache);
if (allStatus && allStatus !== status) {
return "unknown";
} else {
allStatus = status;
}
} finally {
executionOrderCheckedNodes.delete(path.node);
const status = _guessExecutionStatusRelativeToCached(base, path, cache);
if (allStatus && allStatus !== status) {
return "unknown";
} else {
allStatus = status;
}

@@ -313,7 +306,12 @@ }

let nodeMap = cache.get(base.node);
let cached;
if (!nodeMap) {
cache.set(base.node, nodeMap = new Map());
} else if (nodeMap.has(target.node)) {
return nodeMap.get(target.node);
} else if (cached = nodeMap.get(target.node)) {
if (cached === SYMBOL_CHECKING) {
return "unknown";
}
return cached;
}
nodeMap.set(target.node, SYMBOL_CHECKING);
const result = _guessExecutionStatusRelativeToDifferentFunctionsInternal(base, target, cache);

@@ -320,0 +318,0 @@ nodeMap.set(target.node, result);

{
"name": "@babel/traverse",
"version": "7.20.8",
"version": "7.20.10",
"description": "The Babel Traverse module maintains the overall tree state, and is responsible for replacing, removing, and adding nodes",

@@ -5,0 +5,0 @@ "author": "The Babel Team (https://babel.dev/team)",

Sorry, the diff of this file is not supported yet

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