]> git.parisson.com Git - pdf.js.git/commitdiff
PasswordException in closure
authorJakob Miland <saebekassebil@gmail.com>
Thu, 17 May 2012 19:34:39 +0000 (21:34 +0200)
committerJakob Miland <saebekassebil@gmail.com>
Thu, 17 May 2012 19:34:39 +0000 (21:34 +0200)
src/util.js

index ef40f524b0e78543d5d9fdda6e97a383ca51a737..90e6cee5d62737dac80205a61d29340f3d0c8b86 100644 (file)
@@ -58,13 +58,18 @@ function shadow(obj, prop, value) {
   return value;
 }
 
-function PasswordException(msg, code) {
-  this.name = 'PasswordException';
-  this.message = msg;
-  this.code = code;
-}
-PasswordException.prototype = new Error();
-PasswordException.constructor = PasswordException;
+var PasswordException = (function PasswordExceptionClosure() {
+  function PasswordException(msg, code) {
+    this.name = 'PasswordException';
+    this.message = msg;
+    this.code = code;
+  }
+
+  PasswordException.prototype = new Error();
+  PasswordException.constructor = PasswordException;
+
+  return PasswordException;
+})();
 
 function bytesToString(bytes) {
   var str = '';