We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Class Accessor Decorator init addInitializer
https://www.typescriptlang.org/play?ts=5.4.2#code/GYVwdgxgLglg9mABAEwDwDUCGAbEBTAGkQBUALGAZ0QF5FwBrMOAdzAD4AKASkQG8AoREMQAnPFBAikHQcLkB9AG458ALkQBhbJgoUAghAh5dcEQBE8EU5iinimEQHNxqMpSJZceNgVlyhVmBQeAAeUOpaOvqGxhSmFlYiNqYaCMFhruQUHirevnI81Gx8fv7Y4oiK6p74ANylcoHpUAB0mMjIAJJgMLA4MABeeCIc3DTFAv5TiIFx5S3YcI4cAOTtXT192IPDK1z104gAvvv8DcJiElIlh3LOUGOTt1OXkkiKB8-H+V8U4hzKLw8J5fYSKGiVXKfZ5HH7PGCbAG5YHnZ6zODzRbLFYI3p7aGgyoQwF1VG3V7XEl4AmHWFko6ICg2SjAGDGTTaXQGIwmcyWay2EQAJWMIGwUEy7kQNW8BKO9SOZwgnKoxGMUBuwgAAshuKVMDFeYhgBDgDg-gqlQgKBrgjaIWA8MwSOruLUgA
function d<Value, This = unknown>() { return ( _value: ClassAccessorDecoratorTarget<This, Value>, context: ClassAccessorDecoratorContext<This, Value>, ) => { let v: Value; context.addInitializer(() => { console.log('addInitializer'); }); return { get() { return v; }, set(value) { v = value; }, init(value) { console.log('init'); v = value; return value; }, } satisfies ClassAccessorDecoratorResult<This, Value>; }; } class Test { @d() accessor f = false; } const test = new Test();
console.log order: init addInitializer
console.log order: addInitializer init
No response
The text was updated successfully, but these errors were encountered:
I think this was intentional? #56606 #56955
Sorry, something went wrong.
This issue has been marked as "Duplicate" and has seen no recent activity. It has been automatically closed for house-keeping purposes.
No branches or pull requests
π Search Terms
Class Accessor Decorator init addInitializer
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play?ts=5.4.2#code/GYVwdgxgLglg9mABAEwDwDUCGAbEBTAGkQBUALGAZ0QF5FwBrMOAdzAD4AKASkQG8AoREMQAnPFBAikHQcLkB9AG458ALkQBhbJgoUAghAh5dcEQBE8EU5iinimEQHNxqMpSJZceNgVlyhVmBQeAAeUOpaOvqGxhSmFlYiNqYaCMFhruQUHirevnI81Gx8fv7Y4oiK6p74ANylcoHpUAB0mMjIAJJgMLA4MABeeCIc3DTFAv5TiIFx5S3YcI4cAOTtXT192IPDK1z104gAvvv8DcJiElIlh3LOUGOTt1OXkkiKB8-H+V8U4hzKLw8J5fYSKGiVXKfZ5HH7PGCbAG5YHnZ6zODzRbLFYI3p7aGgyoQwF1VG3V7XEl4AmHWFko6ICg2SjAGDGTTaXQGIwmcyWay2EQAJWMIGwUEy7kQNW8BKO9SOZwgnKoxGMUBuwgAAshuKVMDFeYhgBDgDg-gqlQgKBrgjaIWA8MwSOruLUgA
π» Code
π Actual behavior
console.log order:
init
addInitializer
π Expected behavior
console.log order:
addInitializer
init
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: