summaryrefslogtreecommitdiff
path: root/node_modules/rollup-plugin-node-polyfills/polyfills/inherits.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/rollup-plugin-node-polyfills/polyfills/inherits.js')
-rw-r--r--node_modules/rollup-plugin-node-polyfills/polyfills/inherits.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/node_modules/rollup-plugin-node-polyfills/polyfills/inherits.js b/node_modules/rollup-plugin-node-polyfills/polyfills/inherits.js
new file mode 100644
index 0000000..078a7e6
--- /dev/null
+++ b/node_modules/rollup-plugin-node-polyfills/polyfills/inherits.js
@@ -0,0 +1,25 @@
+
+var inherits;
+if (typeof Object.create === 'function'){
+ inherits = function inherits(ctor, superCtor) {
+ // implementation from standard node.js 'util' module
+ ctor.super_ = superCtor
+ ctor.prototype = Object.create(superCtor.prototype, {
+ constructor: {
+ value: ctor,
+ enumerable: false,
+ writable: true,
+ configurable: true
+ }
+ });
+ };
+} else {
+ inherits = function inherits(ctor, superCtor) {
+ ctor.super_ = superCtor
+ var TempCtor = function () {}
+ TempCtor.prototype = superCtor.prototype
+ ctor.prototype = new TempCtor()
+ ctor.prototype.constructor = ctor
+ }
+}
+export default inherits;