@babel/helper-replace-supers
Advanced tools
Comparing version 7.16.0 to 7.16.5
@@ -6,4 +6,15 @@ "use strict"; | ||
}); | ||
exports.environmentVisitor = exports.default = void 0; | ||
exports.skipAllButComputedKey = skipAllButComputedKey; | ||
exports.default = void 0; | ||
Object.defineProperty(exports, "environmentVisitor", { | ||
enumerable: true, | ||
get: function () { | ||
return _helperEnvironmentVisitor.default; | ||
} | ||
}); | ||
Object.defineProperty(exports, "skipAllButComputedKey", { | ||
enumerable: true, | ||
get: function () { | ||
return _helperEnvironmentVisitor.skipAllButComputedKey; | ||
} | ||
}); | ||
@@ -16,6 +27,7 @@ var _traverse = require("@babel/traverse"); | ||
var _helperEnvironmentVisitor = require("@babel/helper-environment-visitor"); | ||
var _t = require("@babel/types"); | ||
const { | ||
VISITOR_KEYS, | ||
assignmentExpression, | ||
@@ -28,3 +40,2 @@ booleanLiteral, | ||
sequenceExpression, | ||
staticBlock, | ||
stringLiteral, | ||
@@ -40,34 +51,3 @@ thisExpression | ||
function skipAllButComputedKey(path) { | ||
if (!path.node.computed) { | ||
path.skip(); | ||
return; | ||
} | ||
const keys = VISITOR_KEYS[path.type]; | ||
for (const key of keys) { | ||
if (key !== "key") path.skipKey(key); | ||
} | ||
} | ||
const environmentVisitor = { | ||
[`${staticBlock ? "StaticBlock|" : ""}ClassPrivateProperty|TypeAnnotation`](path) { | ||
path.skip(); | ||
}, | ||
Function(path) { | ||
if (path.isMethod()) return; | ||
if (path.isArrowFunctionExpression()) return; | ||
path.skip(); | ||
}, | ||
"Method|ClassProperty"(path) { | ||
skipAllButComputedKey(path); | ||
} | ||
}; | ||
exports.environmentVisitor = environmentVisitor; | ||
const visitor = _traverse.default.visitors.merge([environmentVisitor, { | ||
const visitor = _traverse.default.visitors.merge([_helperEnvironmentVisitor.default, { | ||
Super(path, state) { | ||
@@ -86,3 +66,3 @@ const { | ||
const unshadowSuperBindingVisitor = _traverse.default.visitors.merge([environmentVisitor, { | ||
const unshadowSuperBindingVisitor = _traverse.default.visitors.merge([_helperEnvironmentVisitor.default, { | ||
Scopable(path, { | ||
@@ -89,0 +69,0 @@ refName |
{ | ||
"name": "@babel/helper-replace-supers", | ||
"version": "7.16.0", | ||
"version": "7.16.5", | ||
"description": "Helper function to replace supers", | ||
@@ -17,5 +17,6 @@ "repository": { | ||
"dependencies": { | ||
"@babel/helper-member-expression-to-functions": "^7.16.0", | ||
"@babel/helper-environment-visitor": "^7.16.5", | ||
"@babel/helper-member-expression-to-functions": "^7.16.5", | ||
"@babel/helper-optimise-call-expression": "^7.16.0", | ||
"@babel/traverse": "^7.16.0", | ||
"@babel/traverse": "^7.16.5", | ||
"@babel/types": "^7.16.0" | ||
@@ -22,0 +23,0 @@ }, |
@@ -12,3 +12,3 @@ # @babel/helper-replace-supers | ||
```sh | ||
npm install --save-dev @babel/helper-replace-supers | ||
npm install --save @babel/helper-replace-supers | ||
``` | ||
@@ -19,3 +19,3 @@ | ||
```sh | ||
yarn add @babel/helper-replace-supers --dev | ||
yarn add @babel/helper-replace-supers | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9608
5
218
+ Added@babel/helper-environment-visitor@7.24.7(transitive)
Updated@babel/traverse@^7.16.5