Odd: Using prototype as a Singleton
I was perusing the JsUnit code examples and noticed how they used the object’s prototype as a singleton:
var result = TextTestRunner.prototype.main( args );
JsUtil.prototype.quit( result );
Code like this appears throughout the page!
This strikes me with much fear and confusion. Surely, for use as a singleton, any arbitrary property name would be more appropriate than prototype, the home of instance method and property definitions. Why use a secondary namespace instead of the object itself, anyway?
The code base is old, so maybe conventions were not as strong then (though this seems largely fundamental,) or something was lost in translation.
In any case, I’m still looking for a good testing framework to use on the console, or in arbitrary contexts. Edit: found one.