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

fix(utils/decorator): handle desc return value #336

Merged

Conversation

buschtoens
Copy link
Collaborator

While writing tests for legacy decorators for rwjblue/sparkles-component#22, I noticed that the return value is ignored and that the descriptor needs to be mutated by reference.

I don't think that this is intentional, since we do the opposite for stage 2 decorators using the same callback function.

@stefanpenner
Copy link
Contributor

This looks like it needs a regression test.

@buschtoens
Copy link
Collaborator Author

The build error seems to be unrelated. Can someone restart the build, please?

@buschtoens
Copy link
Collaborator Author

There's quite some auto-formatting noise, but since there is a .prettierrc.js, I just kept it, to get it over with. I can undo it though.


(NEEDS_STAGE_1_DECORATORS
? test
: skip)('it warns about deprecated descriptor mutation by reference', function(assert) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Which pattern do you prefer?

(NEEDS_STAGE_1_DECORATORS ? test : skip)('it ...', function(assert) { ... });
if (NEEDS_STAGE_1_DECORATORS) {
  test('it ...', function(assert) { ... });
}

@pzuraq
Copy link
Contributor

pzuraq commented Dec 19, 2018

Great job on this one!

@buschtoens buschtoens merged commit a12792f into ember-decorators:master Dec 19, 2018
@buschtoens buschtoens deleted the fix/handle-desc-return-value branch December 19, 2018 12:04
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

Successfully merging this pull request may close these issues.

None yet

3 participants