Document ol.inherits and annotate as a function
This commit is contained in:
+25
-5
@@ -208,14 +208,34 @@ ol.ZOOMSLIDER_ANIMATION_DURATION = 200;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ol.inherits is an alias to the goog.inherits function. It is exported
|
* Inherit the prototype methods from one constructor into another.
|
||||||
* for use in non-compiled application code.
|
|
||||||
*
|
*
|
||||||
* FIXME: We use a new line to fake the linter. Without the new line the
|
* Usage:
|
||||||
* linter complains with:
|
|
||||||
*
|
*
|
||||||
* "Missing newline between constructor and goog.inherits"
|
* function ParentClass(a, b) { }
|
||||||
|
* ParentClass.prototype.foo = function(a) { }
|
||||||
|
*
|
||||||
|
* function ChildClass(a, b, c) {
|
||||||
|
* goog.base(this, a, b);
|
||||||
|
* }
|
||||||
|
* ol.inherits(ChildClass, ParentClass);
|
||||||
|
*
|
||||||
|
* var child = new ChildClass('a', 'b', 'see');
|
||||||
|
* child.foo(); // This works.
|
||||||
|
*
|
||||||
|
* In addition, a superclass' implementation of a method can be invoked as
|
||||||
|
* follows:
|
||||||
|
*
|
||||||
|
* ChildClass.prototype.foo = function(a) {
|
||||||
|
* ChildClass.superClass_.foo.call(this, a);
|
||||||
|
* // Other code here.
|
||||||
|
* };
|
||||||
|
*
|
||||||
|
* @param {Function} childCtor Child constructor.
|
||||||
|
* @param {Function} parentCtor Parent constructor.
|
||||||
|
* @function
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
ol.inherits =
|
ol.inherits =
|
||||||
goog.inherits;
|
goog.inherits;
|
||||||
|
// note that the newline above is necessary to satisfy the linter
|
||||||
|
|||||||
Reference in New Issue
Block a user