"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/npm/node_modules/inherits/inherits_browser.js" (8 Mar 2017, 672 Bytes) of archive /windows/misc/atom-windows.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Javascript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 if (typeof Object.create === 'function') {
    2   // implementation from standard node.js 'util' module
    3   module.exports = function inherits(ctor, superCtor) {
    4     ctor.super_ = superCtor
    5     ctor.prototype = Object.create(superCtor.prototype, {
    6       constructor: {
    7         value: ctor,
    8         enumerable: false,
    9         writable: true,
   10         configurable: true
   11       }
   12     });
   13   };
   14 } else {
   15   // old school shim for old browsers
   16   module.exports = function inherits(ctor, superCtor) {
   17     ctor.super_ = superCtor
   18     var TempCtor = function () {}
   19     TempCtor.prototype = superCtor.prototype
   20     ctor.prototype = new TempCtor()
   21     ctor.prototype.constructor = ctor
   22   }
   23 }