mirror of
https://github.com/jashkenas/backbone.git
synced 2026-04-30 03:00:06 -04:00
Clarify reference to the parent constructor.
The parent's constructor is 'Function', which is the constructor that created parent. The comments refer to the parent constructor function, not it's constructor function (that is, the constructor that created it).
This commit is contained in:
@@ -1792,7 +1792,7 @@
|
||||
|
||||
// The constructor function for the new subclass is either defined by you
|
||||
// (the "constructor" property in your `extend` definition), or defaulted
|
||||
// by us to simply call the parent's constructor.
|
||||
// by us to simply call the parent constructor.
|
||||
if (protoProps && _.has(protoProps, 'constructor')) {
|
||||
child = protoProps.constructor;
|
||||
} else {
|
||||
@@ -1803,7 +1803,7 @@
|
||||
_.extend(child, parent, staticProps);
|
||||
|
||||
// Set the prototype chain to inherit from `parent`, without calling
|
||||
// `parent`'s constructor function.
|
||||
// `parent` constructor function.
|
||||
var Surrogate = function(){ this.constructor = child; };
|
||||
Surrogate.prototype = parent.prototype;
|
||||
child.prototype = new Surrogate;
|
||||
|
||||
Reference in New Issue
Block a user