TypeScript Version: Version 2.9.2
Search Terms:
es5 string.prototype.repeat
Code
tsconfig.json
{
"compilerOptions": {
"baseUrl": ".",
"outDir": "./build",
"target": "es5",
"lib": ["es6", "dom"],
"jsx": "react",
"moduleResolution": "node",
"rootDir": "./",
},
"exclude": [
"node_modules",
"build"
]
}
Expected behavior:
Expecting String.prototype.repeat to be polyfilled or rewritten in the same manner that async/await syntax in transpiled correctly because the target is es5 and String.prototype.repeat is not part of ES5.
That is according to documentation
--target: Specify ECMAScript target version: "ES3" (default), "ES5", "ES6"/"ES2015", "ES2016", "ES2017" or "ESNext".
Actual behavior:
The expression appears as is
Playground Link:
https://github.com/agoldis/typescript-25853
Related Issues:
#3101