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
// A *self-contained* demonstration of the problem follows...conststr="hello world"if(str.includes("hello")){// do something}
with compile target as es5 Expected behavior:
varstr="hello world"if(str.indexOf("hello")>-1){// do something}
Actual behavior:
varstr="hello world"if(str.includes("hello")){// do something}
An unreasonable thing is some of members refuse to support that feature for ES2016 not being widely used in #2340. However, async and await features in ES2017 are supported by TS 2.3.
Therefore, i think it's time to revisit this requirement.
Otherwise, I have to use babel to transpile the ts output. That's really really ugly and stupid.
The text was updated successfully, but these errors were encountered:
I'm curious, is there a reason you couldn't include a polyfill? As far as I'm aware, TypeScript only attempts to transpile language features, not library functions.
This has been one of the design goals to first impose no additional runtime cost. as a developer you have full control on what polyfills to include, and what to avoid. and second TS does make any type-directed emit. this allows you to use the compiler in a transpile mode where every file is processed in isolation.
TypeScript Version: 2.3.2
Code
with compile target as es5
Expected behavior:
Actual behavior:
An unreasonable thing is some of members refuse to support that feature for ES2016 not being widely used in #2340. However, async and await features in ES2017 are supported by TS 2.3.
Therefore, i think it's time to revisit this requirement.
Otherwise, I have to use babel to transpile the ts output. That's really really ugly and stupid.
The text was updated successfully, but these errors were encountered: