Implement MemberExpressionToFunctions helper (#7763)
* Implement MemberExpressionToFunctions helper
Fixes #7733.
This will also be used to simplify the Private Fields transform, which had [almost the same code](ccd941057a/packages/babel-plugin-proposal-class-properties/src/index.js (L114-L217)) hand written.
* Cleanup
* Little more comment cleanup
* Use unary plus
This can't be redefined, unlike the `Number` identifier.
* Review comments
* Remove unused deps
This commit is contained in:
@@ -29,7 +29,7 @@ function (_Point) {
|
||||
babelHelpers.classCallCheck(this, ColorPoint);
|
||||
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(ColorPoint).call(this));
|
||||
_this.x = 2;
|
||||
babelHelpers.set(babelHelpers.getPrototypeOf(ColorPoint.prototype), "x", 3, _this, true)
|
||||
babelHelpers.set(babelHelpers.getPrototypeOf(ColorPoint.prototype), "x", 3, _this, true);
|
||||
expect(_this.x).toBe(3); // A
|
||||
|
||||
expect(babelHelpers.get(babelHelpers.getPrototypeOf(ColorPoint.prototype), "x", babelHelpers.assertThisInitialized(_this))).toBeUndefined(); // B
|
||||
|
||||
Reference in New Issue
Block a user