summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/inherits/inherits.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/inherits/inherits.js')
-rw-r--r--deps/npm/node_modules/inherits/inherits.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/deps/npm/node_modules/inherits/inherits.js b/deps/npm/node_modules/inherits/inherits.js
new file mode 100644
index 0000000000..061b396207
--- /dev/null
+++ b/deps/npm/node_modules/inherits/inherits.js
@@ -0,0 +1,29 @@
+module.exports = inherits
+
+function inherits (c, p, proto) {
+ proto = proto || {}
+ var e = {}
+ ;[c.prototype, proto].forEach(function (s) {
+ Object.getOwnPropertyNames(s).forEach(function (k) {
+ e[k] = Object.getOwnPropertyDescriptor(s, k)
+ })
+ })
+ c.prototype = Object.create(p.prototype, e)
+ c.super = p
+}
+
+//function Child () {
+// Child.super.call(this)
+// console.error([this
+// ,this.constructor
+// ,this.constructor === Child
+// ,this.constructor.super === Parent
+// ,Object.getPrototypeOf(this) === Child.prototype
+// ,Object.getPrototypeOf(Object.getPrototypeOf(this))
+// === Parent.prototype
+// ,this instanceof Child
+// ,this instanceof Parent])
+//}
+//function Parent () {}
+//inherits(Child, Parent)
+//new Child