Handle destructuring when transpiling to ES5
mihaip opened this issue · comments
Mihai Parparita commented
A component method of the form:
/**
* @param {SomeType} type
* @return {SomeType}
*/
someMethod({
destructuredField1,
destructuredField2,
}) {
...
return 1;
},
Produces a warning:
ERROR - Missing return statement. Function expected to return SomeType.
someMethod({
I believe this is because we copy the arguments (including the arguments) in the generated interface for the component, and then that gets transpiled down to code in the function body.
google/closure-compiler#3004 may be related