| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
I'm not sure if I'm okay with dropping the error message - I think that decorators that won't properly work in ES3 should get an error. |
Sorry, something went wrong.
|
Daniel Rosenwasser (@DanielRosenwasser) Are you talking about a specific error? Part of this change is to have the emit for method decorators in ES3 not include the property descriptor, just as with decorators on property declarations. |
Sorry, something went wrong.
|
but this will have a different behavior for ES3/ES5 for method decorators with no errors. |
Sorry, something went wrong.
|
Yes, if method decorators won't work properly, then you should warn users that method decorators are only supported in ES5 or higher. |
Sorry, something went wrong.
|
Daniel Rosenwasser (@DanielRosenwasser), In this change method decorators will work in the same way that decorators for property declarations work. No descriptor will be provided nor accepted. There will be no error. |
Sorry, something went wrong.
|
Daniel Rosenwasser (@DanielRosenwasser), Mohamed Hegazy (@mhegazy) Any further concerns/discussion with this PR? |
Sorry, something went wrong.
|
👍 |
Sorry, something went wrong.
|
The error that I removed no longer applies. The only difference between decorators in ES3 and ES5 is that ES3 decorators cannot take and don't observe a descriptor. |
Sorry, something went wrong.
|
Ron Buckton (@rbuckton) I'll need to ask a few questions about this offline. |
Sorry, something went wrong.
Allow decorators in ES3
| Back | FazBrowse Home | New Git URL |
This change modifies the checker and the emitter to support the use of decorators when targeting ES3. In addition to removing the ES5-specific use of reduceRight from the __decorate helper, this change also inlines the calls to Object.getOwnPropertyDescriptor and Object.defineProperty in a backwards-compatible fashion that allows us to clean up the emit for ES5 and later by removing various repetitive calls to the aforementioned Object methods.
Addresses #4681.