main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
641 bytes
|
Line | |
---|
1 | "use strict";
|
---|
2 |
|
---|
3 | Object.defineProperty(exports, "__esModule", {
|
---|
4 | value: true
|
---|
5 | });
|
---|
6 | exports.default = rewriteThis;
|
---|
7 | var _core = require("@babel/core");
|
---|
8 | var _traverse = require("@babel/traverse");
|
---|
9 | let rewriteThisVisitor;
|
---|
10 | function rewriteThis(programPath) {
|
---|
11 | if (!rewriteThisVisitor) {
|
---|
12 | rewriteThisVisitor = _traverse.visitors.environmentVisitor({
|
---|
13 | ThisExpression(path) {
|
---|
14 | path.replaceWith(_core.types.unaryExpression("void", _core.types.numericLiteral(0), true));
|
---|
15 | }
|
---|
16 | });
|
---|
17 | rewriteThisVisitor.noScope = true;
|
---|
18 | }
|
---|
19 | (0, _traverse.default)(programPath.node, rewriteThisVisitor);
|
---|
20 | }
|
---|
21 |
|
---|
22 | //# sourceMappingURL=rewrite-this.js.map
|
---|
Note:
See
TracBrowser
for help on using the repository browser.