Revision: 3739
http://vexi.svn.sourceforge.net/vexi/?rev=3739&view=rev
Author: mkpg2
Date: 2009-11-02 14:41:14 +0000 (Mon, 02 Nov 2009)
Log Message:
-----------
LazyProp utility trap function.
Modified Paths:
--------------
trunk/widgets/org.vexi.widgets/src/vexi/util/common.t
Modified: trunk/widgets/org.vexi.widgets/src/vexi/util/common.t
===================================================================
--- trunk/widgets/org.vexi.widgets/src/vexi/util/common.t 2009-11-02
14:10:34 UTC (rev 3738)
+++ trunk/widgets/org.vexi.widgets/src/vexi/util/common.t 2009-11-02
14:41:14 UTC (rev 3739)
@@ -12,6 +12,14 @@
static.noWriteTrap = function(v) { throw "unsupported write: "+trapname+"
= "+v; return; }
static.nullIllegal = function(v) { if (v==null) throw "null value illegal
for '"+trapname+"'"; cascade = v; }
static.readOnly = function(v) { throw "property '"+trapname+"' is read
only"; return; }
+ static.lazyProp = function(f) {
+ return function(){
+ var v = f();
+ trapee[trapname] = v;
+ trapee[trapname] --= callee;
+ return v;
+ };
+ };
static.logException = function(msg) {
try { throw msg; }
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Vexi-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/vexi-svn