Skip to content

Conversation

@StephanH90
Copy link
Contributor

You should call super with ...arguments otherwise bad things happen.

You should call `super` with `...arguments` otherwise bad things happen.
@bmish bmish changed the title Doc: Call super with ...arguments in "Update classic-decorator-hooks.md" Call super in constructor in classic-decorator-hooks rule doc Sep 7, 2021
@bmish bmish changed the title Call super in constructor in classic-decorator-hooks rule doc Super call should include arguments in classic-decorator-hooks rule doc Sep 7, 2021
fix: add `...args` to the constructor as param.
Copy link
Contributor Author

@StephanH90 StephanH90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx for the feedback, I just made another commit to fix this.

@bmish
Copy link
Member

bmish commented Sep 8, 2021

Shouldn't we also fix no-component-lifecycle-hooks.md in this same PR?

but I'm new to Ember and I'm not sure if this is correct:
```javascript
export default class MyComponent extends Component {
  init(...args) {
    this._super(args);
  }
  willDestroy() {} // Both a classic and Glimmer component lifecycle hook
}
```
@bmish bmish changed the title Super call should include arguments in classic-decorator-hooks rule doc Super call missing arguments in some rule docs Sep 10, 2021
Copy link
Member

@bmish bmish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@bmish bmish merged commit 0d991e9 into ember-cli:master Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants