Files
cssd-back/node_modules/@babel/helper-module-transforms/lib/rewrite-this.js
T
2019-07-15 13:07:31 +04:30

25 lines
439 B
JavaScript
Vendored

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = rewriteThis;
function rewriteThis(programPath) {
programPath.traverse(rewriteThisVisitor);
}
const rewriteThisVisitor = {
ThisExpression(path) {
path.replaceWith(path.scope.buildUndefinedNode());
},
Function(path) {
if (!path.isArrowFunctionExpression()) path.skip();
},
ClassProperty(path) {
path.skip();
}
};