setup-kubectl/node_modules/@babel/helper-module-transforms/lib/rewrite-this.js
github-actions[bot] 7f7e5ba5ea
Add node modules and compiled JavaScript from main (#57)
Co-authored-by: Oliver King <oking3@uncc.edu>
2022-06-21 12:18:30 -04:00

31 lines
No EOL
684 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = rewriteThis;
var _helperReplaceSupers = require("@babel/helper-replace-supers");
function rewriteThis(programPath) {
programPath.traverse(rewriteThisVisitor);
}
const rewriteThisVisitor = {
ThisExpression(path) {
path.replaceWith(path.scope.buildUndefinedNode());
},
Function(path) {
if (path.isMethod()) (0, _helperReplaceSupers.skipAllButComputedKey)(path);else if (!path.isArrowFunctionExpression()) path.skip();
},
ClassProperty(path) {
(0, _helperReplaceSupers.skipAllButComputedKey)(path);
},
ClassPrivateProperty(path) {
path.skip();
}
};