Skip to content
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

fix(bigint): Use typeof for testing if BigInt exists #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kdubb
Copy link

@kdubb kdubb commented Jul 22, 2020

The if (BigInt) { … } style does not work in browser environments that do not implement BigInt (e.g. Safari <= 13).

A hasBigInt flag was added and exported from util and uses the format of typeof BigInt !== ‘undefined’ which should work in all environments. All usage of BigInt is now guarded by an equivalent of if (hasBigInt) {…} to ensure it’s available before use.

Connection with issue(s)

Resolve issue #11

Testing and Review Notes

None

To Do

N/A

The `if (BigInt) { … }` style does not work in browser environments that do not implement BigInt (e.g. Safari <= 13).

A `hasBigInt` flag was added and exported from `util` and uses the format of `typeof BigInt !== ‘undefined’` which should work in all environments.  All usage of `BigInt` is now guarded by an equivalent of `if (hasBigInt) {…}` to ensure it’s available before use.
@kdubb
Copy link
Author

kdubb commented Sep 14, 2020

@pichillilorenzo Any chance this can be merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant