"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/es5-ext/object/mixin.js" (8 Mar 2017, 877 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 'use strict';
    2 
    3 var value = require('./valid-value')
    4 
    5   , defineProperty = Object.defineProperty
    6   , getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor
    7   , getOwnPropertyNames = Object.getOwnPropertyNames
    8   , getOwnPropertySymbols = Object.getOwnPropertySymbols;
    9 
   10 module.exports = function (target, source) {
   11     var error, sourceObject = Object(value(source));
   12     target = Object(value(target));
   13     getOwnPropertyNames(sourceObject).forEach(function (name) {
   14         try {
   15             defineProperty(target, name, getOwnPropertyDescriptor(source, name));
   16         } catch (e) { error = e; }
   17     });
   18     if (typeof getOwnPropertySymbols === 'function') {
   19         getOwnPropertySymbols(sourceObject).forEach(function (symbol) {
   20             try {
   21                 defineProperty(target, symbol, getOwnPropertyDescriptor(source, symbol));
   22             } catch (e) { error = e; }
   23         });
   24     }
   25     if (error !== undefined) throw error;
   26     return target;
   27 };