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

babel-helper-evaluate-path

Package Overview
Dependencies
Maintainers
7
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-helper-evaluate-path - npm Package Compare versions

Comparing version 0.4.2 to 0.4.3

30

lib/index.js

@@ -11,4 +11,2 @@ "use strict";

const t = require("@babel/types");
module.exports = function evaluate(path, {

@@ -149,11 +147,16 @@ tdz = false

const declaration = binding.path.parentPath;
/**
* Handle when binding is created inside a parent block and
* the corresponding parent is removed by other plugins
* if (false) { var a } -> var a
*/
if (t.isIfStatement(declaration.parentPath) || t.isLoop(declaration.parentPath) || t.isSwitchCase(declaration.parentPath)) {
if (declaration.parentPath.removed) {
return {
confident: true,
value: void 0
};
}
if (declaration.parentPath && declaration.parentPath.removed) {
return {
confident: true,
value: void 0
};
}
if (declaration.parentPath.isIfStatement() || declaration.parentPath.isLoop() || declaration.parentPath.isSwitchCase()) {
return {

@@ -201,3 +204,3 @@ shouldDeopt: true

if (declaration.parentPath.isIfStatement() || declaration.parentPath.isLoop() || declaration.parentPath.isSwitchCase()) {
if (declaration.parentPath && (declaration.parentPath.isIfStatement() || declaration.parentPath.isLoop() || declaration.parentPath.isSwitchCase())) {
return {

@@ -215,3 +218,8 @@ shouldDeopt: true

const stmts = scopePath.get("body");
let stmts = scopePath.get("body");
if (!Array.isArray(stmts)) {
stmts = [stmts];
}
const compareResult = compareBindingAndReference({

@@ -218,0 +226,0 @@ binding,

{
"name": "babel-helper-evaluate-path",
"version": "0.4.2",
"version": "0.4.3",
"description": "path.evaluate wrapped in a try catch",

@@ -5,0 +5,0 @@ "keywords": [

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