Closed kdalgaard closed 7 years ago
It is possible - it works because TypeScript compiler is emitting output files even if there are some errors during a compilation process. In case of generator functions, TSC will show an error about unknown syntax and it will omit this code block leaving it intact (NOTE: noEmitOnError flag should have default value - which is false)
closing as this was already thoroughly explained here: https://github.com/Microsoft/TypeScript/issues/1564#issuecomment-252903932
Resuming the discussion from here: https://github.com/Microsoft/TypeScript/issues/1564#issuecomment-252832787
I contend that the method below (from the docs of this starter) is not possible, due to the simple reason that it's not possible to compile TS with generators intact to an ES5 target in the first place.