-
Notifications
You must be signed in to change notification settings - Fork 13k
Description
TypeScript Version: 1.7-2.0.3
Code
https://jsfiddle.net/PFight/vLfnpqk0/
Expected behavior:
Minimum target version for decorators is ES5 (that says documentation). When compiling code with target: 0 (ES3), expected to get diagnostics message, that decorators not supported for specified target.
... or decorators for ES3 should work without differences with ES5, and documentation should be fixed.
Actual behavior:
In TypeScript 1.7.0 were added support of decorators for ES3, and compiler error TS1205: Decorators are only available when targeting ECMAScript 5 and higher
were removed. But, there is two differences in generated code for ES3:
- Method and property decorators do not receive third parameter - descriptor
- Return value of method and property decorators is ignored
For example, code work fine in playground, but fails in JSFiddle without meaningfull error, because JSFiddle uses target ES3.