Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle destructuring when transpiling to ES5 #29

Open
mihaip opened this issue Jul 25, 2018 · 0 comments
Open

Handle destructuring when transpiling to ES5 #29

mihaip opened this issue Jul 25, 2018 · 0 comments

Comments

@mihaip
Copy link
Owner

mihaip commented Jul 25, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant