summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/uuid/lib
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/uuid/lib')
-rw-r--r--deps/npm/node_modules/uuid/lib/bytesToUuid.js17
-rw-r--r--deps/npm/node_modules/uuid/lib/rng-browser.js8
-rw-r--r--deps/npm/node_modules/uuid/lib/v35.js6
3 files changed, 19 insertions, 12 deletions
diff --git a/deps/npm/node_modules/uuid/lib/bytesToUuid.js b/deps/npm/node_modules/uuid/lib/bytesToUuid.js
index 2c9a22309a..f201a88854 100644
--- a/deps/npm/node_modules/uuid/lib/bytesToUuid.js
+++ b/deps/npm/node_modules/uuid/lib/bytesToUuid.js
@@ -10,14 +10,15 @@ for (var i = 0; i < 256; ++i) {
function bytesToUuid(buf, offset) {
var i = offset || 0;
var bth = byteToHex;
- return bth[buf[i++]] + bth[buf[i++]] +
- bth[buf[i++]] + bth[buf[i++]] + '-' +
- bth[buf[i++]] + bth[buf[i++]] + '-' +
- bth[buf[i++]] + bth[buf[i++]] + '-' +
- bth[buf[i++]] + bth[buf[i++]] + '-' +
- bth[buf[i++]] + bth[buf[i++]] +
- bth[buf[i++]] + bth[buf[i++]] +
- bth[buf[i++]] + bth[buf[i++]];
+ // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
+ return ([bth[buf[i++]], bth[buf[i++]],
+ bth[buf[i++]], bth[buf[i++]], '-',
+ bth[buf[i++]], bth[buf[i++]], '-',
+ bth[buf[i++]], bth[buf[i++]], '-',
+ bth[buf[i++]], bth[buf[i++]], '-',
+ bth[buf[i++]], bth[buf[i++]],
+ bth[buf[i++]], bth[buf[i++]],
+ bth[buf[i++]], bth[buf[i++]]]).join('');
}
module.exports = bytesToUuid;
diff --git a/deps/npm/node_modules/uuid/lib/rng-browser.js b/deps/npm/node_modules/uuid/lib/rng-browser.js
index 14d21170d5..6361fb8147 100644
--- a/deps/npm/node_modules/uuid/lib/rng-browser.js
+++ b/deps/npm/node_modules/uuid/lib/rng-browser.js
@@ -3,9 +3,11 @@
// and inconsistent support for the `crypto` API. We do the best we can via
// feature-detection
-// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
-var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues.bind(crypto)) ||
- (typeof(msCrypto) != 'undefined' && msCrypto.getRandomValues.bind(msCrypto));
+// getRandomValues needs to be invoked in a context where "this" is a Crypto
+// implementation. Also, find the complete implementation of crypto on IE11.
+var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||
+ (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));
+
if (getRandomValues) {
// WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto
var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
diff --git a/deps/npm/node_modules/uuid/lib/v35.js b/deps/npm/node_modules/uuid/lib/v35.js
index 842c60ea2b..8b066cc5e3 100644
--- a/deps/npm/node_modules/uuid/lib/v35.js
+++ b/deps/npm/node_modules/uuid/lib/v35.js
@@ -43,7 +43,11 @@ module.exports = function(name, version, hashfunc) {
return buf || bytesToUuid(bytes);
};
- generateUUID.name = name;
+ // Function#name is not settable on some platforms (#270)
+ try {
+ generateUUID.name = name;
+ } catch (err) {
+ }
// Pre-defined namespaces, per Appendix C
generateUUID.DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';