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 illegal invocation of getRandomValues #257

Merged
merged 1 commit into from
Jan 16, 2018
Merged

Conversation

Nimelrian
Copy link
Contributor

getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Binding the function to its respective Crypto implementation fixes the illegal invocation.

Fixes #256

@broofa
Copy link
Member

broofa commented Jan 16, 2018

Good catch!

@broofa broofa merged commit 262a8ea into uuidjs:master Jan 16, 2018
@broofa broofa mentioned this pull request Jan 16, 2018
@beck
Copy link

beck commented Jan 16, 2018

No test coverage?

@broofa
Copy link
Member

broofa commented Jan 16, 2018

Nope. Tests currently all run in node, but this is an IE 11 thing. Looking into setting up selenium tests somehow (e.g. Sauce Labs?) If you have suggestions or advice, 'happy to take a PR. :-)

@jsg2021
Copy link

jsg2021 commented Jan 16, 2018

3.2.0 is crashing in chrome too. Can the fix be published to npm?

@Nimelrian
Copy link
Contributor Author

I bound the getRandomValues function of both, window.msCrypto (IE) and window.crypto (Edge, Chrome, FF). Works in all browsers which have one of the two implementations.

@broofa
Copy link
Member

broofa commented Jan 16, 2018

@jsg2021 This should be in npm as v3.2.1. Let me know if you still have issues.

@jsg2021
Copy link

jsg2021 commented Jan 16, 2018

thanks!

@beck
Copy link

beck commented Jan 17, 2018

this is an IE 11 thing

Tripped over this bug earlier this morning when unit testing some react code with enzyme.

Looking into setting up selenium tests somehow (e.g. Sauce Labs?) If you have suggestions or advice, 'happy to take a PR.

👍 - #260

Apologies for the large diff, scaffolding can be a bit painful/verbose. I tried to keep the boilerplate to a minimum.

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.

[3.2.0] Illegal invocation at whatwgRNG
4 participants