Closed TrejGun closed 8 years ago
This is a toughy...
The issue is that we switched to lazily applying the decorator using a getter so that we can apply it to the instance instead of the prototype which resolved another bug. The test suite missed it because I wasn't testing chaining multiple @decorate
calls. I'm experimenting with some solutions.
@TrejGun I believe I've fixed it with #74, gonna let the code stew for a day. Feel free to try if you can.
You can try it out either by building core-decorators yourself or you can download this zip and extract the contents into your node_modules/core-decorators/*
core-decorators.zip
LGTM, thanks!
will this work with something like
@autobind
@decorate(decorator)
test(...args) {
console.log(...args);
}
or
@decorate(decorator)
@autobind
test(...args) {
console.log(...args);
}
?
@TrejGun not at the moment (one breaks the other invokes the method pre-emptively internally so be careful)
This whole thing has been an awful juggling between different requests (e.g. #65), so I'm considering reverting back to the old way of decorating the prototype instead and then introducing an option or a new decorator that will then opt-into decorating the instance instead.
in 0.12.0 this code works
in 0.12.1 it throws