JS is cool, but it suck when dealing with classes and inheritance. Or that’s what I know. Doing it the old fashion way just breaking my heart all the time. Thank God I found this Base.js to mend my heart. Classes and inheritance in JS has never been this easy :) and fun.


// Interfaces
var T = Base.extend( {
mSysT: null,
isValid: function() {
}
} );

// Video classes
var Video_T = T.extend( {
isValid: function() {
return this.mSysT.t() > 10;
}
} );

Uh oh, have I mention that I’ve used SpiderMonkey to summon JS in my console? I do have js in my console. Check this out


[geek@toni singapore-0.10.0]$ js -v
JavaScript-C 1.6 pre-release 1 2006-04-04 (OSSP js 1.6.20060803)
usage: js [-PswWxC] [-b branchlimit] [-c stackchunksize] [-v version] [-f scriptfile] [-e script] [-S maxstacksize] [scriptfile] [scriptarg...]
[geek@toni singapore-0.10.0]$ js
js> print(’foo’);
foo
js> quit
function quit() {
[native code]
}
js>

Sphere: Related Content