So its close, but not quite right. I think I need to setup the prototype
when I create the AppError object, but I'm not sure what to set it to.
I'm also not sure why the message isn't being set.
Besides, this method of creating a throwaway object just to get at its
class definition seems really clunky.
Also, is there a way to call a function as a constructor (ie emulate the
"new" operator) from C? I can see the code in jsexn.c that lets me get
away with doing a normal call to the Exception function, but obviously
that doesn't generalise. Or is the rationale that you do this for
exceptions, use the JS_New* calls for the other builtin objects, and
roll your own for custom classes?