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:eb848eec-ad43-4d10-7f17-6801a296fd11 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C52A:363D8E:360433C:448A776:6B01CDF9 |
| html-safe-nonce | ca9fa84d7af4123663725f1855e9510bfc22a0f283dde3d8647f597089b2fcd5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNTJBOjM2M0Q4RTozNjA0MzNDOjQ0OEE3NzY6NkIwMUNERjkiLCJ2aXNpdG9yX2lkIjoiODE1MzU4NTgzNjU3OTk5OTIyNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 429cd028408ba99819758c94d5e7133c3e99921c923b3c59c71edf6f899a21eb |
| 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