The following TypeScript with async/await...
public async get(from: number, to: number): Promise<Array<M>> {
let models: Array<M> = await this.persistant_repo.get(from, to);
produces the following JavaScript with a yield outside of a generator...
ModelsRepoDecorator.prototype.get = function (from, to) {
var _this = this;
var models = yield this.persistant_repo.get(from, to);
I'm not certain, but I don't think yield should work outside of a generator. I'm running tsc src/**/*.ts --outDir dist --sourceMap and my tsconfig looks like this...
{
"compilerOptions": {
"module": "commonjs",
"target": "ES6",
"noImplicitAny": true,
"removeComments": true,
"preserveConstEnums": true,
"sourceMap": true,
"jsx": "react"
}
}
I think this may be a duplicate of #4135, but I'm not sure how the solution there can be applied here.
The following TypeScript with async/await...
produces the following JavaScript with a yield outside of a generator...
I'm not certain, but I don't think
yieldshould work outside of a generator. I'm runningtsc src/**/*.ts --outDir dist --sourceMapand my tsconfig looks like this...{ "compilerOptions": { "module": "commonjs", "target": "ES6", "noImplicitAny": true, "removeComments": true, "preserveConstEnums": true, "sourceMap": true, "jsx": "react" } }I think this may be a duplicate of #4135, but I'm not sure how the solution there can be applied here.