You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One thing I’ve found really insightful in the past is being able to target ES5 in TS Playground, to see all of the state-machine code that gets generated.
In the recent(ish) upgrade to TS Playground, however, that scenario is moderately broken. As soon as I set the target option to ES5, I get a bunch of red squigglies, saying:
'Promise' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the lib compiler option to es2015 or later.
An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your --lib option.(2705)
Is there any way to still support this scenario? It seems silly to have all these red squigglies, when the code does in fact run perfectly fine in Chrome.
I could set the target to ES2015, but then I don’t get the same type of output (i.e., I see a generator function rather than the full gory details of the ES5 implementation; whereas it’s the latter that I want, screenshotted below). So what I really want is an ES5 output, but with a lib option saying that Promises should be supported.
The text was updated successfully, but these errors were encountered:
One thing I’ve found really insightful in the past is being able to target ES5 in TS Playground, to see all of the state-machine code that gets generated.
In the recent(ish) upgrade to TS Playground, however, that scenario is moderately broken. As soon as I set the target option to ES5, I get a bunch of red squigglies, saying:
Is there any way to still support this scenario? It seems silly to have all these red squigglies, when the code does in fact run perfectly fine in Chrome.
I could set the target to ES2015, but then I don’t get the same type of output (i.e., I see a generator function rather than the full gory details of the ES5 implementation; whereas it’s the latter that I want, screenshotted below). So what I really want is an ES5 output, but with a lib option saying that Promises should be supported.
The text was updated successfully, but these errors were encountered: