Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
var f = new XFile();
f.readFromFile = function(fname) {
if (this.cachedName == fname && this.cachedStr) {
return this.cachedStr;
}
this.name = fname;
this.open();
var str = this.read();
this.close();
this.cachedStr = str;
this.cachedName = fname;
return str;
}
XFile.prototype.readFromFile = function(fname) {...}
f.oldread = f.read ;
f.oldread() ; // does a call on f.read()
f.oldread = f.read ;
f.read = function() {
...
f.oldread() ;
}
XFile.prototype.read = function() { .... }
So the limitations are:
1) You can't define static methods/properties with the CClientLib interface. However you can define static methods on the DLL and call them.
Eg lib = new ExternalObject("lib:slslslsls") ;
lib.property = 'abc' ;
lib.method() ;
2) You can't redefine a property/method of a CClientLib object in JavaScript
Copy link to clipboard
Copied