@babel/helper-member-expression-to-functions
Advanced tools
Comparing version 7.10.3 to 7.10.4
@@ -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" | ||
} |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
11875
269
0
Updated@babel/types@^7.10.4