Title: Impossible to define static 'length' function on class · Issue #442 · microsoft/TypeScript · GitHub
Open Graph Title: Impossible to define static 'length' function on class · Issue #442 · microsoft/TypeScript
X Title: Impossible to define static 'length' function on class · Issue #442 · microsoft/TypeScript
Description: The following typescript program is accepted: class C { static length () { return "twelve"; } } However, in the generated code: var C = (function () { function C() { } C.length = function () { return "twelve"; }; return C; })(); Here, an...
Open Graph Description: The following typescript program is accepted: class C { static length () { return "twelve"; } } However, in the generated code: var C = (function () { function C() { } C.length = function () { retu...
X Description: The following typescript program is accepted: class C { static length () { return "twelve"; } } However, in the generated code: var C = (function () { function C() { } C.length = function...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/442
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Impossible to define static 'length' function on class","articleBody":"The following typescript program is accepted:\n\n``` typescript\nclass C {\n static length () { return \"twelve\"; }\n}\n```\n\nHowever, in the generated code:\n\n``` javascript\nvar C = (function () {\n function C() {\n }\n C.length = function () {\n return \"twelve\";\n };\n return C;\n})();\n```\n\nHere, an attempt is made to assign to the `length` property of a function. This doesn't work (at least in Firefox and Chrome), causing subsequent calls of `C.length()` to crash. Perhaps calling a static class function `length` should just be disallowed?\n\nMigrated from codeplex [issue #1260](http://typescript.codeplex.com/workitem/1260).\n","author":{"url":"https://github.com/hesselink","@type":"Person","name":"hesselink"},"datePublished":"2014-08-12T18:53:09Z","url":"https://github.com/microsoft/TypeScript/issues/442"}
| 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:ef8e2a5e-f461-3f5c-967e-0605069e3e8a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CD82:3DCD28:B231E2:ECCE92:6B01C0F8 |
| html-safe-nonce | 043b61baadcfd7fe8c8bbffdeb300212bef8d57dbe329dc204a0aba12d7cbf39 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRDgyOjNEQ0QyODpCMjMxRTI6RUNDRTkyOjZCMDFDMEY4IiwidmlzaXRvcl9pZCI6IjY2NTA3Njk1Njg0NTk1MDU5MTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 34e08065d9e5d5739e51a078464b35ce96efb1e8996db0248ec353360f1f1f02 |
| hovercard-subject-tag | issue:40086634 |
| 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/442/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ff3c31715f7fda810285eda54b5dff2966a52c28a12e45c9a3100b80f00ae2d4/microsoft/TypeScript/issues/442 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ff3c31715f7fda810285eda54b5dff2966a52c28a12e45c9a3100b80f00ae2d4/microsoft/TypeScript/issues/442 |
| og:image:alt | The following typescript program is accepted: class C { static length () { return "twelve"; } } However, in the generated code: var C = (function () { function C() { } C.length = function () { retu... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hesselink |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width