-
Notifications
You must be signed in to change notification settings - Fork 146
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(logger): decorated class methods cannot access this
#1060
fix(logger): decorated class methods cannot access this
#1060
Conversation
Note to reviewers: don't merge this until #1054 is merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small nit.
Also, similar to #1055, we should also update the examples/cdk/src/*.Decorator.ts
files. They still don't use .bind() method. We can have this in another PR if you prefer (then I'll approve this).
packages/logger/tests/e2e/sampleRate.decorator.test.FunctionCode.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved.
Discussed with @dreamorosi , we'll go with this to push the fix first.
The example will be updated in a separated PR.
Description of your changes
Description of your changes
As described in #1058 the decorator implementation was affected by an issue that prevented the decorated method/class to access other class members as the value of
this
was passed incorrectly.This PR aims at fixing the issue, creating an unit test case, making minimal changes to the function in the e2e test to verify the change, and update docstrings/docs.
A long form explanation of the issue can be found at #1055, when merged this PR will close #1058.
How to verify this change
See checks below the PR, also see the results of the e2e test run.
Related issues, RFCs
Issue number: #1058
PR status
Is this ready for review?: YES
Is it a breaking change?: NO
Checklist
Breaking change checklist
N/A
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.