I forgot to mention this: All methods in your shiny new Classes can call upon the following variables, great for debugging:
scope: will be either 'public' or 'private' type: will be either 'instance' or 'static' member: reference to the actual function memberName: name assigned to actual function self: class to which your methods belong
private statics pSelf: private static variables and methods
public instance members this: the oldy but goody
private instance members pThis: private instance variables and methods
All methods in your shiny new Classes can call upon the following variables, great for debugging:
scope: will be either 'public' or 'private'
type: will be either 'instance' or 'static'
member: reference to the actual function
memberName: name assigned to actual function
self: class to which your methods belong
private statics
pSelf: private static variables and methods
public instance members
this: the oldy but goody
private instance members
pThis: private instance variables and methods
Function.prototype.setScope = function () {
if (typeof this.scope=='undefined')
this.scope={};
(function () {
for (i=0; i<arguments.length; i++)
for (v in arguments[i]);
this.scope[v]=arguments[i][v];
}).apply(this,arguments);
with (this.scope) {
eval('var ret='+this.toString());
}
ret.scope=this.scope;
return ret;
}