You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@babel/plugin-transform-block-scoping

Package Overview
Dependencies
Maintainers
4
Versions
123
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/plugin-transform-block-scoping - npm Package Compare versions

Comparing version

to
8.0.0-beta.0

21

lib/index.js

@@ -469,3 +469,3 @@ import { declare } from '@babel/helper-plugin-utils';

var index = declare((api, opts) => {
api.assertVersion("8.0.0-alpha.17");
api.assertVersion("8.0.0-beta.0");
const {

@@ -508,3 +508,3 @@ throwIfClosureRequired = false,

const updatedBindingsUsages = new Map();
if (headPath && isBlockScoped(headPath.node)) {
if (headPath && isBlockScoped(headPath)) {
const names = Object.keys(headPath.getBindingIdentifiers());

@@ -582,3 +582,3 @@ const headScope = headPath.scope;

function transformBlockScopedVariable(path, state, tdzEnabled) {
if (!isBlockScoped(path.node)) return;
if (!isBlockScoped(path)) return;
const dynamicTDZNames = validateUsage(path, state, tdzEnabled);

@@ -630,8 +630,13 @@ path.node.kind = "var";

}
function isBlockScoped(node) {
function isBlockScoped(path) {
const {
node
} = path;
if (!types.isVariableDeclaration(node)) return false;
if (node[types.BLOCK_SCOPED_SYMBOL]) {
return true;
}
if (!isLetOrConst(node.kind) && node.kind !== "using") {
const {
kind
} = node;
if (kind === "using" || kind === "await using") {
throw path.buildCodeFrameError(`The ${kind} declaration should be first transformed by \`@babel/plugin-proposal-explicit-resource-management\`.`);
} else if (!isLetOrConst(kind)) {
return false;

@@ -638,0 +643,0 @@ }

{
"name": "@babel/plugin-transform-block-scoping",
"version": "8.0.0-alpha.17",
"version": "8.0.0-beta.0",
"description": "Compile ES2015 block scoping (const and let) to ES5",

@@ -17,3 +17,3 @@ "repository": {

"dependencies": {
"@babel/helper-plugin-utils": "^8.0.0-alpha.17"
"@babel/helper-plugin-utils": "^8.0.0-beta.0"
},

@@ -24,11 +24,11 @@ "keywords": [

"peerDependencies": {
"@babel/core": "^8.0.0-alpha.17"
"@babel/core": "^8.0.0-beta.0"
},
"devDependencies": {
"@babel/core": "^8.0.0-alpha.17",
"@babel/helper-plugin-test-runner": "^8.0.0-alpha.17",
"@babel/traverse": "^8.0.0-alpha.17"
"@babel/core": "^8.0.0-beta.0",
"@babel/helper-plugin-test-runner": "^8.0.0-beta.0",
"@babel/traverse": "^8.0.0-beta.0"
},
"engines": {
"node": "^18.20.0 || ^20.17.0 || >=22.8.0"
"node": "^20.19.0 || >=22.12.0"
},

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.