Title: Compiler allows async function expressions in ES3/ES5 · Issue #7334 · microsoft/TypeScript · GitHub
Open Graph Title: Compiler allows async function expressions in ES3/ES5 · Issue #7334 · microsoft/TypeScript
X Title: Compiler allows async function expressions in ES3/ES5 · Issue #7334 · microsoft/TypeScript
Description: TypeScript Version: 1.8 Code // file: index.ts declare class Promise
Open Graph Description: TypeScript Version: 1.8 Code // file: index.ts declare class Promise
X Description: TypeScript Version: 1.8 Code // file: index.ts declare class Promise<T> {/***/} async function foo() { return 42; } // ERROR: Async functions are only available in ES6+ let bar = async functi...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/7334
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Compiler allows async function expressions in ES3/ES5","articleBody":"**TypeScript Version:** \n\n1.8\n\n**Code**\n\n``` ts\n// file: index.ts\ndeclare class Promise\u003cT> {/***/}\nasync function foo() { return 42; } // ERROR: Async functions are only available in ES6+\nlet bar = async function () { return 42; } // OK, but should be an error\nlet baz = async () => 42; // OK, but should be an error\n\n// file: tsconfig.json\n{\n \"compilerOptions\": {\n \"target\": \"es5\"\n }\n}\n```\n\n**Expected behavior:**\nThe `bar` and `baz` lines should also get error TS1311 'Async functions are only available in ES6 or higher'.\n\n**Actual behavior:** \nThe `bar` and `baz` lines compile without errors.\n","author":{"url":"https://github.com/yortus","@type":"Person","name":"yortus"},"datePublished":"2016-03-02T02:58:39Z","url":"https://github.com/microsoft/TypeScript/issues/7334"}
| 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 | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:cb9a3a3a-a249-a88d-21eb-e454f10914da |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C59E:175A3:75D64C:9F8EFC:6AFBFB79 |
| html-safe-nonce | 3a85e18106eae229e71d41f91a20e9d0fb208d18230b05c809ca67fc98e70da1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNTlFOjE3NUEzOjc1RDY0Qzo5RjhFRkM6NkFGQkZCNzkiLCJ2aXNpdG9yX2lkIjoiNTYxNDExNTgxMzU1NzI3MTQxNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ce03c3b2efaeeb924ffcb172b48456685bbe3927907cf24516dbffdf21d48f39 |
| hovercard-subject-tag | issue:137756771 |
| 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/_view_fragments/issues/show/microsoft/TypeScript/7334/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c7c6968e8a530db412742d4acb42617f0634e34a07117dd146f6b96b36b9700d/microsoft/TypeScript/issues/7334 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c7c6968e8a530db412742d4acb42617f0634e34a07117dd146f6b96b36b9700d/microsoft/TypeScript/issues/7334 |
| og:image:alt | TypeScript Version: 1.8 Code // file: index.ts declare class Promise |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | yortus |
| hostname | github.com |
| expected-hostname | github.com |
| None | fa74413a1d84dac536fcca0740780bcbd3207bafec0e51873b73ff8e8cca032f |
| turbo-cache-control | no-preview |
| 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 | b3b5633a74535d9c23385512d534c66c8fde1907 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width