source: trip-planner-front/node_modules/@babel/helper-module-transforms/lib/rewrite-this.js@ 188ee53

Last change on this file since 188ee53 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 671 bytes
Line 
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = rewriteThis;
7
8var _helperReplaceSupers = require("@babel/helper-replace-supers");
9
10var _traverse = require("@babel/traverse");
11
12var _t = require("@babel/types");
13
14const {
15 numericLiteral,
16 unaryExpression
17} = _t;
18
19function rewriteThis(programPath) {
20 (0, _traverse.default)(programPath.node, Object.assign({}, rewriteThisVisitor, {
21 noScope: true
22 }));
23}
24
25const rewriteThisVisitor = _traverse.default.visitors.merge([_helperReplaceSupers.environmentVisitor, {
26 ThisExpression(path) {
27 path.replaceWith(unaryExpression("void", numericLiteral(0), true));
28 }
29
30}]);
Note: See TracBrowser for help on using the repository browser.