We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
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.
reduceRight
__decorate
Object.getOwnPropertyDescriptor
Object.defineProperty
Object
Addresses #4681.
Sorry, something went wrong.
Allow decorators in ES3
7610048
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.
Updated baselines
c46309d
@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.
but this will have a different behavior for ES3/ES5 for method decorators with no errors.
Yes, if method decorators won't work properly, then you should warn users that method decorators are only supported in ES5 or higher.
@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.
Merge branch 'master' into es3Decorators
be6e43e
Fix linter errors
8a41cde
@mhegazy Any further concerns/discussion with this PR?
👍 I am still not sure about the error though
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.
@rbuckton I'll need to ask a few questions about this offline.
Merge pull request #4741 from Microsoft/es3Decorators
331d26f
Successfully merging this pull request may close these issues.