Class inheritance -- chaining JS statements

The following doesn’t work and I’m not sure why:

isc.ClassFactory.defineClass("MyTreeGrid","TreeGrid")
  .addProperties({
    menuID: null
  })
  .setInstanceProperty("showHeader",false);

Whereas this does work:

isc.ClassFactory.defineClass("MyTreeGrid","TreeGrid")
  .addProperties({
    menuID: null
  });

isc.MyTreeGrid.setInstanceProperty("showHeader",false);

I thought addProperties() returned the defined class with properties added? So why can’t I chain statements like this? It’s not that big a deal, but it’s an aesthetic thing – I find it cleaner.

Good catch, the return value is actually incorrect - what is returned is actually something called the instancePrototype. This has been corrected.