diff --git a/src/libsodium/randombytes/randombytes.c b/src/libsodium/randombytes/randombytes.c index 57b46b50..708616b8 100644 --- a/src/libsodium/randombytes/randombytes.c +++ b/src/libsodium/randombytes/randombytes.c @@ -94,22 +94,22 @@ randombytes_stir(void) EM_ASM({ if (Module.getRandomValue === undefined) { try { - var window_ = 'object' === typeof window ? window : self, - crypto_ = typeof window_.crypto !== 'undefined' ? window_.crypto : window_.msCrypto, - randomValuesStandard = function() { - var buf = new Uint32Array(1); - crypto_.getRandomValues(buf); - return buf[0] >>> 0; - }; + var window_ = 'object' === typeof window ? window : self; + var crypto_ = typeof window_.crypto !== 'undefined' ? window_.crypto : window_.msCrypto; + var randomValuesStandard = function() { + var buf = new Uint32Array(1); + crypto_.getRandomValues(buf); + return buf[0] >>> 0; + }; randomValuesStandard(); Module.getRandomValue = randomValuesStandard; } catch (e) { try { - var crypto = require('crypto'), - randomValueNodeJS = function() { - var buf = crypto.randomBytes(4); - return (buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3]) >>> 0; - }; + var crypto = require('crypto'); + var randomValueNodeJS = function() { + var buf = crypto.randomBytes(4); + return (buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3]) >>> 0; + }; randomValueNodeJS(); Module.getRandomValue = randomValueNodeJS; } catch (e) {