decl / dojo users

Disclaimer

I don't actually use Dojo, so if I get any of this wrong please correct me.

WIP

This page is a work-in-progress.

decl for Dojo users

As discussed on the home page, decl and Dojo's declare are similar. Here, we will discuss the differences.

Dojo's declare creates properties of the constructor functions and prototypes it returns. These seem to be a mix of internal stuff for Dojo and "convenience methods," explained here. These "convenience methods" are documented:

inherited
"The method is used to call a superclass method."
getInherited
"This is a companion method to inherited(). The difference is that it doesn't execute the found method, but returns it."
isInstanceOf
"This method checks if an instance is derived from a given class. It is modeled on instanceof operator."

Regarding inherited/getInherited: With decl, calling this.extend within a declaration function returns a reference to the parent constructor's prototype. Invoke its function properties with apply.

Regarding isInstanceOf: Objects created by constructors produced by decl work with the instanceof operator in the usual way, so this is not necessary.