File tree Expand file tree Collapse file tree 1 file changed +25
-5
lines changed Expand file tree Collapse file tree 1 file changed +25
-5
lines changed Original file line number Diff line number Diff line change @@ -208,14 +208,34 @@ ol.ZOOMSLIDER_ANIMATION_DURATION = 200;
208
208
209
209
210
210
/**
211
- * ol.inherits is an alias to the goog.inherits function. It is exported
212
- * for use in non-compiled application code.
211
+ * Inherit the prototype methods from one constructor into another.
213
212
*
214
- * FIXME: We use a new line to fake the linter. Without the new line the
215
- * linter complains with:
213
+ * Usage:
216
214
*
217
- * "Missing newline between constructor and goog.inherits"
215
+ * function ParentClass(a, b) { }
216
+ * ParentClass.prototype.foo = function(a) { }
217
+ *
218
+ * function ChildClass(a, b, c) {
219
+ * goog.base(this, a, b);
220
+ * }
221
+ * ol.inherits(ChildClass, ParentClass);
222
+ *
223
+ * var child = new ChildClass('a', 'b', 'see');
224
+ * child.foo(); // This works.
225
+ *
226
+ * In addition, a superclass' implementation of a method can be invoked as
227
+ * follows:
228
+ *
229
+ * ChildClass.prototype.foo = function(a) {
230
+ * ChildClass.superClass_.foo.call(this, a);
231
+ * // Other code here.
232
+ * };
233
+ *
234
+ * @param {Function } childCtor Child constructor.
235
+ * @param {Function } parentCtor Parent constructor.
236
+ * @function
218
237
* @api
219
238
*/
220
239
ol . inherits =
221
240
goog . inherits ;
241
+ // note that the newline above is necessary to satisfy the linter
You can’t perform that action at this time.
0 commit comments