private
Advanced tools
Comparing version 0.1.5 to 0.1.6
@@ -19,3 +19,3 @@ { | ||
], | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"homepage": "http://github.com/benjamn/private", | ||
@@ -22,0 +22,0 @@ "repository": { |
@@ -52,3 +52,3 @@ "use strict"; | ||
// making guarantees rather than safe bets. | ||
do var uniqueKey = strSlice.call(numToStr.call(rand(), 36), 2); | ||
do var uniqueKey = internString(strSlice.call(numToStr.call(rand(), 36), 2)); | ||
while (hasOwn.call(uniqueKeys, uniqueKey)); | ||
@@ -58,2 +58,8 @@ return uniqueKeys[uniqueKey] = uniqueKey; | ||
function internString(str) { | ||
var obj = {}; | ||
obj[str] = true; | ||
return Object.keys(obj)[0]; | ||
} | ||
// External users might find this function useful, but it is not necessary | ||
@@ -60,0 +66,0 @@ // for the typical use of this module. |
15106
167