JS.Class 1.6.0: Forwardable, State, and Ruby

A little update: JS.Class 1.6.0 is now out. The main new features are a port of Ruby’s Forwardable module for method delegation, an implementation of the State pattern (which I’m using heavily for building UI code), and JS.Ruby, which is something I wrote about a few weeks back. Also, I’ve implemented the extended hook to complement included; all Module objects now implement both of these, making it easier to user modules do define class methods. Head over to the site and give it a whirl.







One Response to “JS.Class 1.6.0: Forwardable, State, and Ruby”

hi james,

i have found your jsclass library and like it - i really like it and want to use it in a firefox-extension i am currently developing. but i get a strange error when loading the “class.js” saying:

Error: func.callsSuper is not a function
Source File: chrome://soba/content/class/jsclass/class.js
Line: 132

here is the relevant code:


131: if (!Function.is(func)) return (object[name] = func);

132: if (!func.callsSuper()) return (object[name] = func);

i do not know what is happening, because it only failes when running in chrome-mode as mozilla extension.

just for testing purpose i have changed:

132: if (!func.callsSuper()) return (object[name] = func);

to

132: if (!func.callsSuper) return (object[name] = func);

and it seams to be working without errors, but i have not digged deep enough into jsclass-code to know what are the overall consequences when doing this change.

do you have any idea why this is happening in chrome mode ?

here is my setup:

jsclass 1.6.0
firefox 2.0.0.14

PS:
your library is really good, but do you plan to add some kind of mailinglist or supportforum ?

thanks in advance
jan

Jan Zimmek added these pithy words on May 28 08 at 10:32 pm

Leave a Reply