mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-02 02:08:24 +08:00
There don't appear to be any relevant breaking changes in https://github.com/monounity/karma-typescript/releases/tag/v5.0.0 R=jacktfranklin@chromium.org DISABLE_THIRD_PARTY_CHECK=Update karma-typescript Bug: 1068145 Change-Id: I780d8c572bbfc4253f3ff5e52a33c23733d4262a Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2137388 Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org> Reviewed-by: Jack Franklin <jacktfranklin@chromium.org> Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
31 lines
684 B
JavaScript
31 lines
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();
|
|
}
|
|
|
|
}; |