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

@babel/plugin-transform-react-jsx-self

Package Overview
Dependencies
Maintainers
6
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/plugin-transform-react-jsx-self - npm Package Compare versions

Comparing version 7.14.5 to 7.14.9

44

lib/index.js

@@ -14,8 +14,46 @@ "use strict";

function getThisFunctionParent(path) {
let scope = path.scope;
do {
if (scope.path.isFunctionParent() && !scope.path.isArrowFunctionExpression()) {
return scope.path;
}
} while (scope = scope.parent);
return null;
}
function isDerivedClass(classPath) {
return classPath.node.superClass !== null;
}
function isThisAllowed(path) {
const parentMethodOrFunction = getThisFunctionParent(path);
if (parentMethodOrFunction === null) {
return true;
}
if (!parentMethodOrFunction.isMethod()) {
return true;
}
if (parentMethodOrFunction.node.kind !== "constructor") {
return true;
}
return !isDerivedClass(parentMethodOrFunction.parentPath.parentPath);
}
var _default = (0, _helperPluginUtils.declare)(api => {
api.assertVersion(7);
const visitor = {
JSXOpeningElement({
node
}) {
JSXOpeningElement(path) {
if (!isThisAllowed(path)) {
return;
}
const node = path.node;
const id = _core.types.jsxIdentifier(TRACE_ID);

@@ -22,0 +60,0 @@

4

package.json
{
"name": "@babel/plugin-transform-react-jsx-self",
"version": "7.14.5",
"version": "7.14.9",
"description": "Add a __self prop to all JSX Elements",

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

"devDependencies": {
"@babel/core": "7.14.5",
"@babel/core": "7.14.8",
"@babel/helper-plugin-test-runner": "7.14.5",

@@ -29,0 +29,0 @@ "@babel/plugin-syntax-jsx": "7.14.5"

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