-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
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
Avoid using **
with BigInt
#6506
Merged
Muhammad-Altabba
merged 7 commits into
4.x
from
6187-typeerror-cannot-convert-a-bigint-value-to-a-number
Oct 16, 2023
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
45f317d
user static numbers to remove ** at web3-utils converters.ts
Muhammad-Altabba 59b9731
precalculate numbers limits to avoid **
Muhammad-Altabba d3a1a18
implement bigintPower to avoid ** with bigint
Muhammad-Altabba 85a5b37
Merge branch '4.x' into 6187-typeerror-cannot-convert-a-bigint-value-…
Muhammad-Altabba 827f28e
Merge branch '4.x' into 6187-typeerror-cannot-convert-a-bigint-value-…
Muhammad-Altabba 70b0e70
update CHANGELOG.md files
Muhammad-Altabba 628cacf
fill `numberLimits` in a loop
Muhammad-Altabba File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exponentiation Operator usage issue was solved by specifying min browser versions in one of issue?
Its supported in ECMAScript 2016 and
Chrome 52 | Edge 14 | Firefox 52 | Safari 10.1 | Opera 39
Jul 2016 | Aug 2016 | Mar 2017 | Mar 2017 | Aug 2016
so react with older browsers is causing this problem only, and if some one specify min browsers list in react config and use on ECMAScript 2016 supporting browser there is no issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, the issue is present with the latest as well as any older version of React . And any other framework that uses babel (the latest version of babel and any older version as well).
And this is what happens:
**
toMath.pow
.Math.pow
does not work withBigInt
.Currently, the only way to avoid this behavior is to add configuration to
package.json
as mentioned in: babel/babel#13109 (comment) and applied in #6187 (comment)And this MR propose changes so the users do not need to add configurations to their
package.json
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is better to have our own bigint pow function right now. and wait while Babel starts supporting it