Initial commit
[yaffs-website] / node_modules / globule / node_modules / inherits / inherits.js
1 module.exports = inherits
2
3 function inherits (c, p, proto) {
4   proto = proto || {}
5   var e = {}
6   ;[c.prototype, proto].forEach(function (s) {
7     Object.getOwnPropertyNames(s).forEach(function (k) {
8       e[k] = Object.getOwnPropertyDescriptor(s, k)
9     })
10   })
11   c.prototype = Object.create(p.prototype, e)
12   c.super = p
13 }
14
15 //function Child () {
16 //  Child.super.call(this)
17 //  console.error([this
18 //                ,this.constructor
19 //                ,this.constructor === Child
20 //                ,this.constructor.super === Parent
21 //                ,Object.getPrototypeOf(this) === Child.prototype
22 //                ,Object.getPrototypeOf(Object.getPrototypeOf(this))
23 //                 === Parent.prototype
24 //                ,this instanceof Child
25 //                ,this instanceof Parent])
26 //}
27 //function Parent () {}
28 //inherits(Child, Parent)
29 //new Child