Socket
Socket
Sign inDemoInstall

@babel/helper-create-class-features-plugin

Package Overview
Dependencies
Maintainers
6
Versions
107
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/helper-create-class-features-plugin - npm Package Compare versions

Comparing version 7.8.3 to 7.8.6

37

lib/misc.js

@@ -43,15 +43,16 @@ "use strict";

const classFieldDefinitionEvaluationTDZVisitor = _core.traverse.visitors.merge([{
ReferencedIdentifier(path) {
if (this.classBinding && this.classBinding === path.scope.getBinding(path.node.name)) {
const classNameTDZError = this.file.addHelper("classNameTDZError");
function handleClassTDZ(path, state) {
if (state.classBinding && state.classBinding === path.scope.getBinding(path.node.name)) {
const classNameTDZError = state.file.addHelper("classNameTDZError");
const throwNode = _core.types.callExpression(classNameTDZError, [_core.types.stringLiteral(path.node.name)]);
const throwNode = _core.types.callExpression(classNameTDZError, [_core.types.stringLiteral(path.node.name)]);
path.replaceWith(_core.types.sequenceExpression([throwNode, path.node]));
path.skip();
}
path.replaceWith(_core.types.sequenceExpression([throwNode, path.node]));
path.skip();
}
}
}, _helperReplaceSupers.environmentVisitor]);
const classFieldDefinitionEvaluationTDZVisitor = {
ReferencedIdentifier: handleClassTDZ
};

@@ -93,11 +94,19 @@ function injectInitialization(path, constructor, nodes, renamer) {

const declarations = [];
const state = {
classBinding: path.node.id && path.scope.getBinding(path.node.id.name),
file
};
for (const computedPath of computedPaths) {
computedPath.traverse(classFieldDefinitionEvaluationTDZVisitor, {
classBinding: path.node.id && path.scope.getBinding(path.node.id.name),
file
});
const computedKey = computedPath.get("key");
if (computedKey.isReferencedIdentifier()) {
handleClassTDZ(computedKey, state);
} else {
computedKey.traverse(classFieldDefinitionEvaluationTDZVisitor, state);
}
const computedNode = computedPath.node;
if (!computedPath.get("key").isConstantExpression()) {
if (!computedKey.isConstantExpression()) {
const ident = path.scope.generateUidIdentifierBasedOnNode(computedNode.key);

@@ -104,0 +113,0 @@ path.scope.push({

{
"name": "@babel/helper-create-class-features-plugin",
"version": "7.8.3",
"version": "7.8.6",
"author": "The Babel Team (https://babeljs.io/team)",

@@ -21,3 +21,3 @@ "license": "MIT",

"@babel/helper-plugin-utils": "^7.8.3",
"@babel/helper-replace-supers": "^7.8.3",
"@babel/helper-replace-supers": "^7.8.6",
"@babel/helper-split-export-declaration": "^7.8.3"

@@ -29,6 +29,6 @@ },

"devDependencies": {
"@babel/core": "^7.8.3",
"@babel/core": "^7.8.6",
"@babel/helper-plugin-test-runner": "^7.8.3"
},
"gitHead": "a7620bd266ae1345975767bbc7abf09034437017"
"gitHead": "750d3dde3bd2d390819820fd22c05441da78751b"
}
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