Title: Narrow const variables in function declarations · Issue #8976 · microsoft/TypeScript · GitHub
Open Graph Title: Narrow const variables in function declarations · Issue #8976 · microsoft/TypeScript
X Title: Narrow const variables in function declarations · Issue #8976 · microsoft/TypeScript
Description: With #8849, control flow analysis happens thorough function expression and lambda boundaries for const variables. it should also be applied to function declarations, class expressions, and class declarations, etc.. so today this works: c...
Open Graph Description: With #8849, control flow analysis happens thorough function expression and lambda boundaries for const variables. it should also be applied to function declarations, class expressions, and class de...
X Description: With #8849, control flow analysis happens thorough function expression and lambda boundaries for const variables. it should also be applied to function declarations, class expressions, and class de...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/8976
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Narrow const variables in function declarations","articleBody":"With https://github.com/Microsoft/TypeScript/pull/8849, control flow analysis happens thorough function expression and lambda boundaries for const variables.\n\nit should also be applied to function declarations, class expressions, and class declarations, etc..\n\nso today this works:\n\n``` ts\nconst x: number | number[] = []\n\nvar cb = function () {\n x.push(1)\n}\n```\n\nbut not this:\n\n``` ts\nconst x: number | number[] = []\n\nfunction cb() {\n x.push(1)\n}\n```\n","author":{"url":"https://github.com/mhegazy","@type":"Person","name":"mhegazy"},"datePublished":"2016-06-05T21:35:32Z","url":"https://github.com/microsoft/TypeScript/issues/8976"}
| 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:6eb49551-4294-156c-aba1-618fcd6c8554 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9EA8:882E2:EB9CD4:137E407:6B00FE41 |
| html-safe-nonce | 6d157e3f08c977e41eb854083ec32e80d42dff5a880e3bf81947cb012e95eaa4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RUE4Ojg4MkUyOkVCOUNENDoxMzdFNDA3OjZCMDBGRTQxIiwidmlzaXRvcl9pZCI6IjQ0NjkwMDkzODQxOTc5MTQxNzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 4f197cbcaf20e1c0fe09b38e4da28c16521173bc9ca00dfd6131bf73e3f6ff80 |
| hovercard-subject-tag | issue:158576295 |
| 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/8976/issue_layout |
| twitter:image | https://opengraph.githubassets.com/aefb64a4e854e52e3683d9c7712bc5e12d27753b0a42155434ad8fcea6d465ee/microsoft/TypeScript/issues/8976 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/aefb64a4e854e52e3683d9c7712bc5e12d27753b0a42155434ad8fcea6d465ee/microsoft/TypeScript/issues/8976 |
| og:image:alt | With #8849, control flow analysis happens thorough function expression and lambda boundaries for const variables. it should also be applied to function declarations, class expressions, and class de... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mhegazy |
| hostname | github.com |
| expected-hostname | github.com |
| None | e208d86428ec00a57ade75058166297440e8128a01e5287c31a53dc042bbf187 |
| 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 | 7dafd017fb7809a839c443dba08622af38e63c09 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width