Socket
Socket
Sign inDemoInstall

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

Package Overview
Dependencies
Maintainers
4
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.24.8 to 7.25.0

16

lib/decorators-2018-09.js

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

var _helperReplaceSupers = require("@babel/helper-replace-supers");
var _helperFunctionName = require("@babel/helper-function-name");
function hasOwnDecorators(node) {

@@ -55,2 +54,9 @@ var _node$decorators;

}
if (path.isFunction()) {
{
var _path$ensureFunctionN;
(_path$ensureFunctionN = path.ensureFunctionName) != null ? _path$ensureFunctionN : path.ensureFunctionName = require("@babel/traverse").NodePath.prototype.ensureFunctionName;
}
path.ensureFunctionName(false);
}
const {

@@ -71,9 +77,3 @@ node,

if (_core.types.isClassMethod(node)) {
const id = node.computed ? null : node.key;
const transformed = _core.types.toExpression(node);
properties.push(prop("value", (0, _helperFunctionName.default)({
node: transformed,
id,
scope
}) || transformed));
properties.push(prop("value", _core.types.toExpression(node)));
} else if (_core.types.isClassProperty(node) && node.value) {

@@ -80,0 +80,0 @@ properties.push(method("value", _core.template.statements.ast`return ${node.value}`));

@@ -9,3 +9,2 @@ "use strict";

var _helperReplaceSupers = require("@babel/helper-replace-supers");
var _helperSplitExportDeclaration = require("@babel/helper-split-export-declaration");
var _helperSkipTransparentExpressionWrappers = require("@babel/helper-skip-transparent-expression-wrappers");

@@ -1284,3 +1283,7 @@ var _fields = require("./fields.js");

const isAnonymous = !declaration.id;
const updatedVarDeclarationPath = (0, _helperSplitExportDeclaration.default)(path);
{
var _path$splitExportDecl;
(_path$splitExportDecl = path.splitExportDeclaration) != null ? _path$splitExportDecl : path.splitExportDeclaration = require("@babel/traverse").NodePath.prototype.splitExportDeclaration;
}
const updatedVarDeclarationPath = path.splitExportDeclaration();
if (isAnonymous) {

@@ -1296,3 +1299,7 @@ visitClass(updatedVarDeclarationPath, state, _core.types.stringLiteral("default"));

if ((declaration == null ? void 0 : declaration.type) === "ClassDeclaration" && isDecorated(declaration)) {
(0, _helperSplitExportDeclaration.default)(path);
{
var _path$splitExportDecl2;
(_path$splitExportDecl2 = path.splitExportDeclaration) != null ? _path$splitExportDecl2 : path.splitExportDeclaration = require("@babel/traverse").NodePath.prototype.splitExportDeclaration;
}
path.splitExportDeclaration();
}

@@ -1299,0 +1306,0 @@ },

@@ -13,4 +13,4 @@ "use strict";

var _core = require("@babel/core");
var _traverse = require("@babel/traverse");
var _helperReplaceSupers = require("@babel/helper-replace-supers");
var _helperEnvironmentVisitor = require("@babel/helper-environment-visitor");
var _helperMemberExpressionToFunctions = require("@babel/helper-member-expression-to-functions");

@@ -126,3 +126,3 @@ var _helperOptimiseCallExpression = require("@babel/helper-optimise-call-expression");

function privateNameVisitorFactory(visitor) {
const nestedVisitor = _core.traverse.visitors.merge([Object.assign({}, visitor), _helperEnvironmentVisitor.default]);
const nestedVisitor = _traverse.visitors.environmentVisitor(Object.assign({}, visitor));
const privateNameVisitor = Object.assign({}, visitor, {

@@ -824,3 +824,3 @@ Class(path) {

}
const thisContextVisitor = _core.traverse.visitors.merge([{
const thisContextVisitor = _traverse.visitors.environmentVisitor({
Identifier(path, state) {

@@ -855,3 +855,3 @@ if (state.argumentsPath && path.node.name === "arguments") {

}
}, _helperEnvironmentVisitor.default]);
});
const innerReferencesVisitor = {

@@ -858,0 +858,0 @@ ReferencedIdentifier(path, state) {

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

var _core = require("@babel/core");
var _helperFunctionName = require("@babel/helper-function-name");
var _helperSplitExportDeclaration = require("@babel/helper-split-export-declaration");
var _decorators = require("./decorators.js");

@@ -101,8 +99,8 @@ var _semver = require("semver");

if (typeof file.get(versionKey) === "number") {
file.set(versionKey, "7.24.8");
file.set(versionKey, "7.25.0");
return;
}
}
if (!file.get(versionKey) || _semver.lt(file.get(versionKey), "7.24.8")) {
file.set(versionKey, "7.24.8");
if (!file.get(versionKey) || _semver.lt(file.get(versionKey), "7.25.0")) {
file.set(versionKey, "7.25.0");
}

@@ -115,3 +113,3 @@ },

var _ref;
if (file.get(versionKey) !== "7.24.8") return;
if (file.get(versionKey) !== "7.25.0") return;
if (!(0, _features.shouldTransform)(path, file)) return;

@@ -174,3 +172,7 @@ const pathIsClassDeclaration = path.isClassDeclaration();

if (!innerBinding || !pathIsClassDeclaration) {
(0, _helperFunctionName.default)(path);
{
var _path$ensureFunctionN;
(_path$ensureFunctionN = path.ensureFunctionName) != null ? _path$ensureFunctionN : path.ensureFunctionName = require("@babel/traverse").NodePath.prototype.ensureFunctionName;
}
path.ensureFunctionName(false);
ref = path.scope.generateUidIdentifier((innerBinding == null ? void 0 : innerBinding.name) || "Class");

@@ -234,7 +236,11 @@ }

{
if (file.get(versionKey) !== "7.24.8") return;
if (file.get(versionKey) !== "7.25.0") return;
const decl = path.get("declaration");
if (decl.isClassDeclaration() && (0, _decorators2.hasDecorators)(decl.node)) {
if (decl.node.id) {
(0, _helperSplitExportDeclaration.default)(path);
{
var _path$splitExportDecl;
(_path$splitExportDecl = path.splitExportDeclaration) != null ? _path$splitExportDecl : path.splitExportDeclaration = require("@babel/traverse").NodePath.prototype.splitExportDeclaration;
}
path.splitExportDeclaration();
} else {

@@ -241,0 +247,0 @@ decl.node.type = "ClassExpression";

@@ -10,4 +10,4 @@ "use strict";

var _core = require("@babel/core");
var _helperEnvironmentVisitor = require("@babel/helper-environment-visitor");
const findBareSupers = _core.traverse.visitors.merge([{
var _traverse = require("@babel/traverse");
const findBareSupers = _traverse.visitors.environmentVisitor({
Super(path) {

@@ -24,3 +24,3 @@ const {

}
}, _helperEnvironmentVisitor.default]);
});
const referenceVisitor = {

@@ -27,0 +27,0 @@ "TSTypeAnnotation|TypeAnnotation"(path) {

{
"name": "@babel/helper-create-class-features-plugin",
"version": "7.24.8",
"version": "7.25.0",
"author": "The Babel Team (https://babel.dev/team)",

@@ -22,9 +22,7 @@ "license": "MIT",

"@babel/helper-annotate-as-pure": "^7.24.7",
"@babel/helper-environment-visitor": "^7.24.7",
"@babel/helper-function-name": "^7.24.7",
"@babel/helper-member-expression-to-functions": "^7.24.8",
"@babel/helper-optimise-call-expression": "^7.24.7",
"@babel/helper-replace-supers": "^7.24.7",
"@babel/helper-replace-supers": "^7.25.0",
"@babel/helper-skip-transparent-expression-wrappers": "^7.24.7",
"@babel/helper-split-export-declaration": "^7.24.7",
"@babel/traverse": "^7.25.0",
"semver": "^6.3.1"

@@ -36,5 +34,5 @@ },

"devDependencies": {
"@babel/core": "^7.24.8",
"@babel/core": "^7.24.9",
"@babel/helper-plugin-test-runner": "^7.24.7",
"@babel/preset-env": "^7.24.8",
"@babel/preset-env": "^7.25.0",
"@types/charcodes": "^0.2.0",

@@ -41,0 +39,0 @@ "charcodes": "^0.2.0"

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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