Title: Inconsistent parameter properties initialization order depending on the target syntax with useDefineForClassFields · Issue #45995 · microsoft/TypeScript · GitHub
Open Graph Title: Inconsistent parameter properties initialization order depending on the target syntax with useDefineForClassFields · Issue #45995 · microsoft/TypeScript
X Title: Inconsistent parameter properties initialization order depending on the target syntax with useDefineForClassFields · Issue #45995 · microsoft/TypeScript
Description: Bug Report 🔎 Search Terms properties initialization esnext order initialization fields useDefineForClassFields 🕗 Version & Regression Information This is the behavior in every version I tried, and I reviewed the FAQ for entries about cla...
Open Graph Description: Bug Report 🔎 Search Terms properties initialization esnext order initialization fields useDefineForClassFields 🕗 Version & Regression Information This is the behavior in every version I tried, and ...
X Description: Bug Report 🔎 Search Terms properties initialization esnext order initialization fields useDefineForClassFields 🕗 Version & Regression Information This is the behavior in every version I tried, ...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/45995
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Inconsistent parameter properties initialization order depending on the target syntax with useDefineForClassFields","articleBody":"# Bug Report\r\n\r\n\u003c!--\r\n Please fill in each section completely. Thank you!\r\n-->\r\n\r\n### 🔎 Search Terms\r\n\r\nproperties initialization esnext order initialization fields useDefineForClassFields\r\n\r\n### 🕗 Version & Regression Information\r\n\r\n\u003c!-- When did you start seeing this bug occur?\r\n\r\n\"Bugs\" that have existed in TS for a long time are very likely to be FAQs; refer to\r\n https://github.com/Microsoft/TypeScript/wiki/FAQ#common-bugs-that-arent-bugs\r\n\r\nIf possible, please try testing the nightly version of TS to see if it's already been fixed.\r\nFor npm: `typescript@next`\r\nThis is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly\r\n\r\nNote: The TypeScript Playground can be used to try older versions of TypeScript.\r\n\r\nPlease keep and fill in the line that best applies:\r\n-->\r\n- This is the behavior in every version I tried, and I reviewed the FAQ for entries about classes\r\n\r\nRef: https://github.com/babel/babel/issues/13779\r\n\r\n### ⏯ Playground Link\r\n\r\n\u003c!--\r\n A link to a TypeScript Playground \"Share\" link which shows this behavior\r\n\r\n The TypeScript Workbench can be used for more complex setups, try\r\n https://www.typescriptlang.org/dev/bug-workbench/\r\n\r\n As a last resort, you can link to a repo, but these will be slower for us to investigate.\r\n-->\r\n[Playground link with relevant code (ES2021 target)](https://www.typescriptlang.org/play?useDefineForClassFields=true&target=8#code/HYUw7gBAxgNghgZwRAIogFgIwPZwE4AmEA3gFAQUTBwC2IEAvNNsAtjCAHQzYDmAFABd0ASwSda2AK7BBASgDc5SlBYJBeKVEHY8-AA5TMMEVAiSZggFxUpNTCDxySyigF9Sb-gEZFQA)\r\n\r\n[Playground link with relevant code (ESNext target)](https://www.typescriptlang.org/play?useDefineForClassFields=true&target=99#code/HYUw7gBAxgNghgZwRAIogFgIwPZwE4AmEA3gFAQUTBwC2IEAvNNsAtjCAHQzYDmAFABd0ASwSda2AK7BBASgDc5SlBYJBeKVEHY8-AA5TMMEVAiSZggFxUpNTCDxySyigF9Sb-gEZFQA)\r\n\r\n### 💻 Code\r\n\r\n\u003c!-- Please post the relevant code sample here as well-->\r\n```ts\r\nnew class Dashboard {\r\n name = console.log(this.amount);\r\n constructor(public amount: number) {\r\n }\r\n}(1);\r\n```\r\n\r\n### 🙁 Actual behavior\r\n\r\nWhen targeting ES2021 `this.amount` is initialized first; when targeting ESNext `this.name` is initialized first.\r\n\r\n### 🙂 Expected behavior\r\n\r\nThey should be consistent.","author":{"url":"https://github.com/nicolo-ribaudo","@type":"Person","name":"nicolo-ribaudo"},"datePublished":"2021-09-21T21:09:01Z","url":"https://github.com/microsoft/TypeScript/issues/45995"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| 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:c17eae18-0d08-432b-87cf-ceca29ac5b68 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AA20:ABE51:C4D3F8:101E56E:6AED4CC8 |
| html-safe-nonce | 79773502c208d5e8afb466a5d614453a6cb2a0afabe338db23272ecb807da549 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQTIwOkFCRTUxOkM0RDNGODoxMDFFNTZFOjZBRUQ0Q0M4IiwidmlzaXRvcl9pZCI6IjQ1OTMxNTY2NDY1NDMxMTc1MTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 52c27da3b1e4601c50f9bf7ed04df3ef9655baa781e0908059334d2a92e93dbe |
| hovercard-subject-tag | issue:1003286978 |
| 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/45995/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d6534520e31ead1523b9cbcdc3fa5f4df4df4f9361de91939cc11a612628a965/microsoft/TypeScript/issues/45995 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d6534520e31ead1523b9cbcdc3fa5f4df4df4f9361de91939cc11a612628a965/microsoft/TypeScript/issues/45995 |
| og:image:alt | Bug Report 🔎 Search Terms properties initialization esnext order initialization fields useDefineForClassFields 🕗 Version & Regression Information This is the behavior in every version I tried, and ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nicolo-ribaudo |
| hostname | github.com |
| expected-hostname | github.com |
| None | 56fb42677ae87ed3e64410323d67980aa65d0485568a7858f874e7edfc6d1c11 |
| 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 | 9c9a37e2423ed382cf39f70b5aa4b4858b40a3b0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width