Skip to content

fix: support bigints in update expressions for private fields#14311

Merged
nicolo-ribaudo merged 2 commits intobabel:mainfrom
magic-akari:fix/issue-14302
Feb 27, 2022
Merged

fix: support bigints in update expressions for private fields#14311
nicolo-ribaudo merged 2 commits intobabel:mainfrom
magic-akari:fix/issue-14302

Conversation

@magic-akari
Copy link
Copy Markdown
Contributor

@magic-akari magic-akari commented Feb 26, 2022

Q                       A
Fixed Issues? Fixes #14302
Patch: Bug Fix? 👍
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

Copy link
Copy Markdown
Contributor

@JLHwung JLHwung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@JLHwung JLHwung added PR: Bug Fix 🐛 A type of pull request used for our changelog categories Spec: Class Fields labels Feb 26, 2022
this.#privateFieldValue = -(this.#privateFieldValue ** this.#privateFieldValue);
this.publicFieldValue = -(this.publicFieldValue ** this.publicFieldValue);

this.#privateField = 0n;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you split this new test into a new one (updates-bigint) and add "minNodeVersion": "10.0.0" to its options.json file? Because older versions don't support bigints.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment thread packages/babel-helper-member-expression-to-functions/src/index.ts
@nicolo-ribaudo nicolo-ribaudo changed the title fix: update expression for class private field fix: support bigints in update expressions for private fields Feb 27, 2022
@nicolo-ribaudo nicolo-ribaudo merged commit 7ff3084 into babel:main Feb 27, 2022
@magic-akari magic-akari deleted the fix/issue-14302 branch March 8, 2022 06:11
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Jun 8, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Bug Fix 🐛 A type of pull request used for our changelog categories Spec: Class Fields

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: update private field which is bigint would throw type error

3 participants