3 ms·
Unfortunately, it's not. TS classes are not JS classes, TS has it's own implementation of async/await, etc. Just check any compiled TS code and you'll see it.
by sesm 6y ago
Unfortunately, it's not.
TS classes are not JS classes, TS has it's own implementation of async/await, etc. Just check any compiled TS code and you'll see it. It's very frustrating when you want to quickly patch a bug in 3rd-party library.
- sime2009 6y agoYou are most likely looking at code which has been compiled to target an older ES version which doesn't have these features.
- paavohtl 6y agoTS can target older versions of JS without modern features, just like Babel. If you target a more recent latest release of ES, the emitted JS should be pretty much the same as the source TS, just without type annotations.