Open wkeese opened 12 years ago
According to the ES spec, when defining a new function, it is given a prototype with a constructor
property (§13.2). This doesn’t mean a function is a constructor; just like the existence or non-existence of the prototype
property, it just means it may be used as a constructor. Usage of lang.extend
, however, is a concrete indicator that a function is a constructor so I’ll be sure to update that code to reflect it.
I see. Regardless though, seems like you should mark it as class-like if any properties are added to the prototype, or added directly to the object via this.foo = ... syntax, ex:
define([
], function(){
return ctor(){
this.foo = function(a){ ... };
};
});
Some example modules that need to get marked as constructors:
The code below uses lang.extend() rather than dojo.declare() to create a "class":
The parsed output is:
The parser clearly recognizes this as class-like at some level, hence the faux
constructor
method.However, the object is marked as type="function". I would expect type="constructor" classlike="true".