Files
automatic-dispose/node_modules/@babel/helper-module-transforms/lib/rewrite-this.js
2018-11-24 14:43:59 +01:00

25 lines
439 B
JavaScript

"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();
}
};