How to use the @babel/helper-replace-supers.environmentVisitor function in @babel/helper-replace-supers

To help you get started, we’ve selected a few @babel/helper-replace-supers examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alan-ai / alan-sdk-reactnative / testtools / node_modules / @babel / helper-create-class-features-plugin / lib / misc.js View on Github external
const findBareSupers = _core.traverse.visitors.merge([{
  Super(path) {
    const {
      node,
      parentPath
    } = path;

    if (parentPath.isCallExpression({
      callee: node
    })) {
      this.push(parentPath);
    }
  }

}, _helperReplaceSupers.environmentVisitor]);

const referenceVisitor = {
  "TSTypeAnnotation|TypeAnnotation"(path) {
    path.skip();
  },

  ReferencedIdentifier(path) {
    if (this.scope.hasOwnBinding(path.node.name)) {
      this.scope.rename(path.node.name);
      path.skip();
    }
  }

};

function handleClassTDZ(path, state) {

@babel/helper-replace-supers

Helper function to replace supers

MIT
Latest version published 2 months ago

Package Health Score

95 / 100
Full package analysis

Similar packages