aboutsummaryrefslogtreecommitdiff
path: root/src/library_uuid.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/library_uuid.js')
-rw-r--r--src/library_uuid.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/library_uuid.js b/src/library_uuid.js
index 9a0377ae..adfd1882 100644
--- a/src/library_uuid.js
+++ b/src/library_uuid.js
@@ -35,7 +35,8 @@ mergeInto(LibraryManager.library, {
var rb = require('crypto').randomBytes;
uuid = rb(16);
} catch(e) {}
- } else if (typeof(window.crypto) !== 'undefined' &&
+ } else if (ENVIRONMENT_IS_WEB &&
+ typeof(window.crypto) !== 'undefined' &&
typeof(window.crypto.getRandomValues) !== 'undefined') {
// If crypto.getRandomValues is available try to use it.
uuid = new Uint8Array(16);