* test: add test for nullish coalescing
Co-Authored-By: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
* test: add control group
* test: add tests for optional chaining
Co-Authored-By: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
* test: add tests on optional chaining mixed with private class elements
* fix: wrap member chains to IIFE when it is in parameter default
* chore: add more testcases
* chore: update test fixtures
* fix: NodePath.get is always non nullish
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
* 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>
* Memoize in loose mode when callee is a CallExpression
* Handle more complex OptionalCallExpressions where memoization is needed
* Convert calls to Function#call when member needs memoization
* Only update call context for member expressions
* Fix optional chaining bug regarding spread in function calls
* Revamp optional-chain to be top down
Instead of going both upwards and downwards from the first real optional expression, we can just start from the top down.
* Add more tests
* Added optionalExpression types to babylon and babel-types
* OptionalChain transforms bug fix
* Added OptionalExpressions to babel-generator. Fixed OptionalChain Bugs
* Removed 'optionalChain' from newExpression and added test cases
* Added test cases for optionalChain
* Update index.js