Support transforming params of arrow functions in class fields (#13941)

This commit is contained in:
Nicolò Ribaudo
2021-11-09 12:12:23 +01:00
committed by GitHub
parent a6a526968d
commit 43f989941b
17 changed files with 167 additions and 20 deletions

View File

@@ -23,6 +23,10 @@ export default declare((api, options) => {
) {
// default/rest visitors require access to `arguments`, so it cannot be an arrow
path.arrowFunctionToExpression({ noNewArrows });
// In some cases arrowFunctionToExpression replaces the function with a wrapper.
// Return early; the wrapped function will be visited later in the AST traversal.
if (!path.isFunctionExpression()) return;
}
const convertedRest = convertFunctionRest(path);