Title: In JS, out-of-order prototype assignments crash in the binder · Issue #22725 · microsoft/TypeScript · GitHub
Open Graph Title: In JS, out-of-order prototype assignments crash in the binder · Issue #22725 · microsoft/TypeScript
X Title: In JS, out-of-order prototype assignments crash in the binder · Issue #22725 · microsoft/TypeScript
Description: // @allowJs: true // @checkJs: true // @noEmit: true // @filename: a.js OOOrder.prototype.m = function () { this.p = 1 } function OOOrder() { this.x = 1 } Expected behavior: No crash, and OOOrder has instance type { p: number | undefined...
Open Graph Description: // @allowJs: true // @checkJs: true // @noEmit: true // @filename: a.js OOOrder.prototype.m = function () { this.p = 1 } function OOOrder() { this.x = 1 } Expected behavior: No crash, and OOOrder h...
X Description: // @allowJs: true // @checkJs: true // @noEmit: true // @filename: a.js OOOrder.prototype.m = function () { this.p = 1 } function OOOrder() { this.x = 1 } Expected behavior: No crash, and OOOrder h...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/22725
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"In JS, out-of-order prototype assignments crash in the binder","articleBody":"```ts\r\n// @allowJs: true\r\n// @checkJs: true\r\n// @noEmit: true\r\n// @filename: a.js\r\nOOOrder.prototype.m = function () {\r\n this.p = 1\r\n}\r\nfunction OOOrder() {\r\n this.x = 1\r\n}\r\n```\r\n\r\n**Expected behavior:**\r\nNo crash, and `OOOrder` has instance type `{ p: number | undefined, x: number }`\r\n\r\n**Actual behavior:**\r\nCrash in the binder trying to add `p` to `OOOrder`: `constructorSymbol.members = constructorSymbol.members || createSymbolTable();` when `constructorSymbol` isn't defined.\r\n\r\nBefore #22643, this incorrectly added `p` to the instance of `m`, which is incorrect. So falling back to the old behaviour isn't a good option. Instead it needs the same created-nested-namespace logic as bindPropertyAssignment and bindExportsPropertyAssignment.","author":{"url":"https://github.com/sandersn","@type":"Person","name":"sandersn"},"datePublished":"2018-03-20T18:03:14Z","url":"https://github.com/microsoft/TypeScript/issues/22725"}
| 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:cebd028c-0569-0666-ebe5-3030da92cde7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D914:21BD98:26AE734:311EDA3:6B01CB06 |
| html-safe-nonce | 3f314e0b29ed3677196f43e29972cfd6448da5909b4aed226b95b23f09e86da5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOTE0OjIxQkQ5ODoyNkFFNzM0OjMxMUVEQTM6NkIwMUNCMDYiLCJ2aXNpdG9yX2lkIjoiNTIxMzcyNjcyMTU2NzczODYzMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | bfda0eee518eb0e62a1aff212e053440c9d949d5fd880cdbcc9b43e27bb2e627 |
| hovercard-subject-tag | issue:306977883 |
| 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/22725/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b9cf430a6e1638228368bedc6bdb8c0d7412f21a18a3153d9830d087b5404304/microsoft/TypeScript/issues/22725 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b9cf430a6e1638228368bedc6bdb8c0d7412f21a18a3153d9830d087b5404304/microsoft/TypeScript/issues/22725 |
| og:image:alt | // @allowJs: true // @checkJs: true // @noEmit: true // @filename: a.js OOOrder.prototype.m = function () { this.p = 1 } function OOOrder() { this.x = 1 } Expected behavior: No crash, and OOOrder h... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sandersn |
| 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