I'm having trouble using $super in methods other than initialize.

var Reactor = Class.create({
     initialize: function (name) {
         this.name = name;

     work: function (event) {
         console.log("default " + this.name + " working " +  
Object.toJSON(event) );

var ReactorFoo = Class.create(Reactor, {
     initialize: function ($super) {
         this.fooUpdate = {
             peopleStart: null,
             companiesStart: null,
             projectsStart: null,
             changedProjects: [],
             numAlerts: 0

     // redefines the work method
     work: function ($super, event) {

        // do more stuff

Creating and calling a Reactor works fine:

     var reactor = new Reactor("foo");

Creating a reactorFoo works fine:
     var reactorFop = new ReactorFoo();

... but then calling the work method gets a "TypeError: Result of  
expression '$super.work' [undefined] is not a function." error:

You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to