Decorator spec normative changes - static accessors and natural this in decorators #53752
Closed
4 tasks done
Labels
Fix Available
A PR has been opened for this issue
Needs Investigation
This issue needs a team member to investigate its status.
Milestone
Suggestion
π Search Terms
decorators, decorators normative changes
β Viability Checklist
My suggestion meets these guidelines:
This does change behaviour, but given this is a spec change TypeScript should be doing so regardless.
β Suggestion
This is a spec change in the decorators proposal. TypeScript should implement these changes.
Changes
Of the changes, only static accessors and natural this in decorators are behaviour that will have to change. The other changes were either not implemented by TypeScript (SetFunctionName), spec bugs (HomeObject stuff), or the new behaviour is already implemented by TypeScript (addInitializer throws on non-function).
For natural this in decorators the following should not type error, and in down-leveling should not cause the assertion to fail either (playground link):
For static accessors this should succeed at runtime in down-leveling, the typing is already correct (playground link):
The text was updated successfully, but these errors were encountered: