pari: branch 2.0 r3885 - /branches/2.0/config/js/astman.js

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Wed Sep 24 19:30:08 CDT 2008


Author: pari
Date: Wed Sep 24 19:30:08 2008
New Revision: 3885

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=3885
Log:

 make sure that the function is always used as a constructor



Modified:
    branches/2.0/config/js/astman.js

Modified: branches/2.0/config/js/astman.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/astman.js?view=diff&rev=3885&r1=3884&r2=3885
==============================================================================
--- branches/2.0/config/js/astman.js (original)
+++ branches/2.0/config/js/astman.js Wed Sep 24 19:30:08 2008
@@ -674,8 +674,8 @@
 	},
 
 	customObject : function(){
-		// NOTE: use this as a constructor only,  EX: var something = new ASTGUI.customObject;
 		//	eliminates the need of 'hasOwnProperty' to read this objects propeties, look for this objects prototype below.
+		if ( !(this instanceof ASTGUI.customObject) ) { return new ASTGUI.customObject(); }
 	},
 
 	toCustomObject : function(a){// if a is a native object returns an ASTGUI.customObject version of a




More information about the asterisk-gui-commits mailing list