Oliver Dunk db56261414
Skip TSAsExpression when transforming spread in CallExpression (#11404)
* Skip TSAsExpression when transforming spread in CallExpression

* Create @babel/helper-get-call-context package

* Support OptionalCallExpressions

* Use helper in optional chaining plugin, and move tests

* Update package.json files

* Use dot notation to access property

* Remove private method tests until future MR

* Update packages/babel-plugin-transform-spread/package.json

* Rename @babel/helper-get-call-context to @babel/helper-skip-transparent-expr-wrappers

* Handle typed OptionalMemberExpressions

* Make @babel/helper-skip-transparent-expr-wrappers a dependency

* Support TSNonNullExpressions

* Use named import instead of default

* Add test for call context when parenthesized call expression has type

* Improve handling of member expressions inside transparent expression wrappers

* Add comment explaining what a transparent expression wrapper is

* Add newlines to test fixtures

* Pass correct parameter type to skipTransparentExprWrappers

* Rename to babel-helper-skip-transparent-expression-wrappers

* Remove getCallContext helper

* Fixed exports key

* Preserve types in babel-plugin-transform-spread tests

* Use external-helpers to avoid inlining helper functions in tests

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-07-30 14:17:37 -04:00

11 lines
617 B
JavaScript

var _a, _a2, _a3, _b, _a4, _a4$b, _a5, _c, _a6, _a7;
(_a = a) === null || _a === void 0 ? void 0 : _a.b.c;
(_a2 = a) === null || _a2 === void 0 ? void 0 : _a2.b.c.d;
(_a3 = a) === null || _a3 === void 0 ? void 0 : _a3.b.c.d;
(_b = a.b) === null || _b === void 0 ? void 0 : _b.c;
(_a4 = a) === null || _a4 === void 0 ? void 0 : (_a4$b = _a4.b) === null || _a4$b === void 0 ? void 0 : _a4$b.c;
(_a5 = a) === null || _a5 === void 0 ? void 0 : (_c = _a5.b.c) === null || _c === void 0 ? void 0 : _c.c;
((_a6 = a) === null || _a6 === void 0 ? void 0 : _a6.b).c;
((_a7 = a) === null || _a7 === void 0 ? void 0 : _a7.b).c;