You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Enable "useDefineForClassFields" in tsc --init #39311
As of 4.0, we have errors around places where [[Set]] and [[Define]] differences are observable.
[[Define]] semantics are at stage 3, so strict standards compliance isn't really a motivator yet.
We have existing features with non-compliant emit, iteration for example, and errors to prevent the non-compliance from being observed, so there's precedence for prioritising good emit over standards compliance.
If we had multiple --init options, this would be the perfect addition to a "latest" init.
From discussion in the design meeting: We decided not to do this until [[Define]] semantics ship in some ES20xx spec, and that ES20xx becomes the default target in tsc --init.
Currently the default target is ES5, which we need to rethink -- in my opinion, ES2015 at least should be the default.
Activity
RyanCavanaugh commentedon Jun 29, 2020
I think this is a good idea. Anders Hejlsberg (@ahejlsberg) Daniel Rosenwasser (@DanielRosenwasser) thoughts?
Enable "useDefineForClassFields" in tsc --init
sandersn commentedon Jul 2, 2020
Three concerns we should discuss:
[[Set]]and[[Define]]differences are observable.[[Define]]semantics are at stage 3, so strict standards compliance isn't really a motivator yet.We have existing features with non-compliant emit, iteration for example, and errors to prevent the non-compliance from being observed, so there's precedence for prioritising good emit over standards compliance.
If we had multiple
--initoptions, this would be the perfect addition to a "latest" init.orta commentedon Jul 5, 2020
I added it to the recommended tsconfig base: tsconfig/bases#15
sandersn commentedon Sep 18, 2020
From discussion in the design meeting: We decided not to do this until
[[Define]]semantics ship in some ES20xx spec, and that ES20xx becomes the default target intsc --init.Currently the default target is ES5, which we need to rethink -- in my opinion, ES2015 at least should be the default.