"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/mixto/lib/mixin.js" (7 Feb 2017, 1400 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 (function() {
    2   var ExcludedClassProperties, ExcludedPrototypeProperties, Mixin, name;
    3 
    4   module.exports = Mixin = (function() {
    5     Mixin.includeInto = function(constructor) {
    6       var name, value, _ref;
    7       this.extend(constructor.prototype);
    8       for (name in this) {
    9         value = this[name];
   10         if (ExcludedClassProperties.indexOf(name) === -1) {
   11           if (!constructor.hasOwnProperty(name)) {
   12             constructor[name] = value;
   13           }
   14         }
   15       }
   16       return (_ref = this.included) != null ? _ref.call(constructor) : void 0;
   17     };
   18 
   19     Mixin.extend = function(object) {
   20       var name, _i, _len, _ref, _ref1;
   21       _ref = Object.getOwnPropertyNames(this.prototype);
   22       for (_i = 0, _len = _ref.length; _i < _len; _i++) {
   23         name = _ref[_i];
   24         if (ExcludedPrototypeProperties.indexOf(name) === -1) {
   25           if (!object.hasOwnProperty(name)) {
   26             object[name] = this.prototype[name];
   27           }
   28         }
   29       }
   30       return (_ref1 = this.prototype.extended) != null ? _ref1.call(object) : void 0;
   31     };
   32 
   33     function Mixin() {
   34       if (typeof this.extended === "function") {
   35         this.extended();
   36       }
   37     }
   38 
   39     return Mixin;
   40 
   41   })();
   42 
   43   ExcludedClassProperties = ['__super__'];
   44 
   45   for (name in Mixin) {
   46     ExcludedClassProperties.push(name);
   47   }
   48 
   49   ExcludedPrototypeProperties = ['constructor', 'extended'];
   50 
   51 }).call(this);