From b655b414d8a7d119cb535da890e2ae76fd6fc7e8 Mon Sep 17 00:00:00 2001 From: Jakob Miland Date: Thu, 17 May 2012 21:34:39 +0200 Subject: [PATCH] PasswordException in closure --- src/util.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/util.js b/src/util.js index ef40f524b..90e6cee5d 100644 --- a/src/util.js +++ b/src/util.js @@ -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 = '';