Socket
Socket
Sign inDemoInstall

@babel/helper-member-expression-to-functions

Package Overview
Dependencies
4
Maintainers
6
Versions
75
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.10.3 to 7.10.4

17

lib/index.js

@@ -135,6 +135,8 @@ "use strict";

if (rootParentPath.isUnaryExpression({
const isDeleteOperation = rootParentPath.isUnaryExpression({
operator: "delete"
})) {
throw member.buildCodeFrameError(`can't handle delete`);
});
if (isDeleteOperation && endPath.isOptionalMemberExpression() && endPath.get("property").isPrivateName()) {
throw member.buildCodeFrameError(`can't delete a private class element`);
}

@@ -218,4 +220,11 @@

endPath.replaceWith(t.conditionalExpression(t.logicalExpression("||", t.binaryExpression("===", baseNeedsMemoised ? t.assignmentExpression("=", baseRef, startingNode) : baseRef, t.nullLiteral()), t.binaryExpression("===", t.cloneNode(baseRef), scope.buildUndefinedNode())), scope.buildUndefinedNode(), regular));
let replacementPath = endPath;
if (isDeleteOperation) {
replacementPath = endParentPath;
regular = endParentPath.node;
}
replacementPath.replaceWith(t.conditionalExpression(t.logicalExpression("||", t.binaryExpression("===", baseNeedsMemoised ? t.assignmentExpression("=", baseRef, startingNode) : baseRef, t.nullLiteral()), t.binaryExpression("===", t.cloneNode(baseRef), scope.buildUndefinedNode())), isDeleteOperation ? t.booleanLiteral(true) : scope.buildUndefinedNode(), regular));
if (context) {

@@ -222,0 +231,0 @@ const endParent = endParentPath.node;

{
"name": "@babel/helper-member-expression-to-functions",
"version": "7.10.3",
"version": "7.10.4",
"description": "Helper function to replace certain member expressions with function calls",

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

"dependencies": {
"@babel/types": "^7.10.3"
"@babel/types": "^7.10.4"
},
"gitHead": "2787ee2f967b6d8e1121fca00a8d578d75449a53"
"gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc