Permalink
Browse files

avoid var scoping issues when used in the browser

  • Loading branch information...
1 parent 7a6f3a4 commit 72743ae4c540b95f1e1114c887c10037d29e1c71 @zaach zaach committed Dec 4, 2012
Showing with 9 additions and 8 deletions.
  1. +9 −8 client/crypto.js
View
@@ -1,3 +1,12 @@
+
+if (typeof sjcl === 'undefined') {
+ var sjcl = require('./sjcl.js');
+}
+
+if (typeof URLParse === 'undefined') {
+ var URLParse = require('./urlparse.js');
+}
+
var GombotCrypto = (function() {
// the number of rounds used in PBKDF2 to generate a stretched derived
// key from a user password.
@@ -22,14 +31,6 @@ var GombotCrypto = (function() {
DELETE: true
};
- if (typeof sjcl === 'undefined') {
- var sjcl = require('./sjcl.js');
- }
-
- if (typeof URLParse === 'undefined') {
- var URLParse = require('./urlparse.js');
- }
-
return {
seed: function(entropy, cb) {
setTimeout(cb, 0);

0 comments on commit 72743ae

Please sign in to comment.