Title: async/await compiles to yield outside of a generator · Issue #6242 · microsoft/TypeScript · GitHub
Open Graph Title: async/await compiles to yield outside of a generator · Issue #6242 · microsoft/TypeScript
X Title: async/await compiles to yield outside of a generator · Issue #6242 · microsoft/TypeScript
Description: TypeScript is a superset of JavaScript that compiles to clean JavaScript output. - async/await compiles to yield outside of a generator · Issue #6242 · microsoft/TypeScript
Open Graph Description: TypeScript is a superset of JavaScript that compiles to clean JavaScript output. - async/await compiles to yield outside of a generator · Issue #6242 · microsoft/TypeScript
X Description: TypeScript is a superset of JavaScript that compiles to clean JavaScript output. - async/await compiles to yield outside of a generator · Issue #6242 · microsoft/TypeScript
Opengraph URL: https://github.com/microsoft/TypeScript
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"async/await compiles to yield outside of a generator","articleBody":"The following TypeScript with async/await...\n\n``` typescript\npublic async get(from: number, to: number): Promise\u003cArray\u003cM>> {\n let models: Array\u003cM> = await this.persistant_repo.get(from, to);\n```\n\nproduces the following JavaScript with a yield outside of a generator...\n\n``` javascript\nModelsRepoDecorator.prototype.get = function (from, to) {\n var _this = this;\n var models = yield this.persistant_repo.get(from, to);\n```\n\nI'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...\n\n``` json\n{\n \"compilerOptions\": {\n \"module\": \"commonjs\",\n \"target\": \"ES6\",\n \"noImplicitAny\": true,\n \"removeComments\": true,\n \"preserveConstEnums\": true,\n \"sourceMap\": true,\n \"jsx\": \"react\"\n }\n}\n```\n\nI think this may be a duplicate of #4135, but I'm not sure how the solution there can be applied here.\n","author":{"url":"https://github.com/ryasmi","@type":"Person","name":"ryasmi"},"datePublished":"2015-12-24T17:51:00Z","url":"https://github.com/microsoft/TypeScript/issues/6242"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/issues/:id(.:format) |
| route-controller | issues |
| route-action | show |
| fetch-nonce | v2:06155b5b-c1c0-ab11-e990-7e7e4f16cd93 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8DBE:134361:E43C2C:12D2EB3:6B00FEE1 |
| html-safe-nonce | 00dd45918859b1a50e6eccdf062feb1486b5fd8bc95fec71c60af366531c38ae |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4REJFOjEzNDM2MTpFNDNDMkM6MTJEMkVCMzo2QjAwRkVFMSIsInZpc2l0b3JfaWQiOiIyOTU1MzU5MTM0MDg3NzA4Mzg1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f52760c4f5835e41c8e6c6162c3c596317d7ecf8131825da90d1c91d939ccd5b |
| hovercard-subject-tag | repository:20929025 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/microsoft/TypeScript/issues/6242 |
| twitter:image | https://opengraph.githubassets.com/e15f464ad8bbc0886f9cd391ce162cf993e58707e2cc6a0d2b7f905bfb541c3b/microsoft/TypeScript |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e15f464ad8bbc0886f9cd391ce162cf993e58707e2cc6a0d2b7f905bfb541c3b/microsoft/TypeScript |
| og:image:alt | TypeScript is a superset of JavaScript that compiles to clean JavaScript output. - async/await compiles to yield outside of a generator · Issue #6242 · microsoft/TypeScript |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| turbo-cache-control | no-cache |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width