We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
From today's TC39 meeting, the committee has decided to reverse the order of initializers.
function minusTwo({ set, get }) { return { set(v) { set.call(this, v - 2) }, init(v) { return v - 2; } } } function timesFour({ set, get }) { return { set(v) { set.call(this, v * 4) }, init(v) { return v * 4; } } } class Foo { @minusTwo @timesFour accessor bar = 5; } const foo = new Foo(); console.log({ init: foo.bar }); foo.bar = 5; console.log({ set: foo.bar });
{ "jsc": { "transform": { "useDefineForClassFields": true, "decoratorVersion": "2022-03" }, "parser": { "syntax": "typescript", "decorators": true }, "target": "es2015", "loose": false, }, "module": { "type": "es6" }, "isModule": true, "minify": false }
https://play.swc.rs/?version=1.3.58&code=H4sIAAAAAAAAA6WQQQ7CIBBF13KKv2xN7cLoxqaJq57AC1RClYQyCUPtwnB3Aa2JrkzcAH%2Fm%2FckfhslKr8li1Hbi00zFHax8hYvyCCXuAnDKT87mJ1KzuJUvkWUte2MKf9Vc4YYNtmXuhSpf2uoPw2tYBpsnGM%2BwEkGIYQnj9ai4o8n9m2aN3W9pIvidRpqeGR1Rpo%2FLB%2BH4TodeSsVMDufeocW%2ByT6y7DFEXwur5jShKJtcJqNqQ5e4VQpySFCdrCH2xSLSnNUXHhf7pB%2B9EpXkuAEAAA%3D%3D&config=H4sIAAAAAAAAA2WPMQ%2BCMBCFd34FuVkTrNHBVcPm6t7A1dSUHrkriYTw3y1gCcbt7vV77%2FWGLM%2FhJRVc8iGOcQmsvRjiZpWi2Ane0FiPJfHVaZHSoqslIoE73CWsxopYB%2BIHsljy8R1UodS%2BOMLMjAsKrWZB3jZI74N%2BT4bQtygV2zbAf3Cq%2FEkLmp8YJi%2BKKg6nrw8ckWCUjXYyf3I2QEN153BzcSxczGdYISv3hKUTobHemj4FZuMHZWKX0j0BAAA%3D
The set and init logs should be equivalent, because init runs minusTwo's init first then timesFour's.
minusTwo
timesFour
"{init: 12}" "{set: 12}"
The set and init logs are different, because init runs timesFour's init first then minusTwo's.
"{init: 18}" "{set: 12}"
1.3.58
No response
The text was updated successfully, but these errors were encountered:
kdy1
Successfully merging a pull request may close this issue.
Describe the bug
From today's TC39 meeting, the committee has decided to reverse the order of initializers.
Input code
Config
Playground link
https://play.swc.rs/?version=1.3.58&code=H4sIAAAAAAAAA6WQQQ7CIBBF13KKv2xN7cLoxqaJq57AC1RClYQyCUPtwnB3Aa2JrkzcAH%2Fm%2FckfhslKr8li1Hbi00zFHax8hYvyCCXuAnDKT87mJ1KzuJUvkWUte2MKf9Vc4YYNtmXuhSpf2uoPw2tYBpsnGM%2BwEkGIYQnj9ai4o8n9m2aN3W9pIvidRpqeGR1Rpo%2FLB%2BH4TodeSsVMDufeocW%2ByT6y7DFEXwur5jShKJtcJqNqQ5e4VQpySFCdrCH2xSLSnNUXHhf7pB%2B9EpXkuAEAAA%3D%3D&config=H4sIAAAAAAAAA2WPMQ%2BCMBCFd34FuVkTrNHBVcPm6t7A1dSUHrkriYTw3y1gCcbt7vV77%2FWGLM%2FhJRVc8iGOcQmsvRjiZpWi2Ane0FiPJfHVaZHSoqslIoE73CWsxopYB%2BIHsljy8R1UodS%2BOMLMjAsKrWZB3jZI74N%2BT4bQtygV2zbAf3Cq%2FEkLmp8YJi%2BKKg6nrw8ckWCUjXYyf3I2QEN153BzcSxczGdYISv3hKUTobHemj4FZuMHZWKX0j0BAAA%3D
Expected behavior
The set and init logs should be equivalent, because init runs
minusTwo
's init first thentimesFour
's.Actual behavior
The set and init logs are different, because init runs
timesFour
's init first thenminusTwo
's.Version
1.3.58
Additional context
No response
The text was updated successfully, but these errors were encountered: