* Don't insert `__self: this` prior to `super()` calls (#13550) `__self: this` is inserted for debugging purposes. However, it will cause a runtime error if it is inserted prior to a `super()` call in a constructor. This commit will prevent `__self: this` from inserted when there is a following `super()` call. * Prevent adding `__self` within a constructor that has `super()` altogether. * Fix 2 typos in the comments. * Add an additional test case for constructors that do not have a `super()` call. * Detect `super()` call by testing whether the class has a superclass. * Update method name and corresponding comments * Add an additional test for the case where the derived class do not have a `super()` call. * Apply the same changes to babel-plugin-transform-react-jsx
@babel/plugin-transform-react-jsx-self
Add a __self prop to all JSX Elements
See our website @babel/plugin-transform-react-jsx-self for more information.
Install
Using npm:
npm install --save-dev @babel/plugin-transform-react-jsx-self
or using yarn:
yarn add @babel/plugin-transform-react-jsx-self --dev