"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/es5-ext/object/assign/shim.js" (7 Feb 2017, 483 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 keys  = require('../keys')
    4   , value = require('../valid-value')
    5 
    6   , max = Math.max;
    7 
    8 module.exports = function (dest, src/*, …srcn*/) {
    9     var error, i, l = max(arguments.length, 2), assign;
   10     dest = Object(value(dest));
   11     assign = function (key) {
   12         try { dest[key] = src[key]; } catch (e) {
   13             if (!error) error = e;
   14         }
   15     };
   16     for (i = 1; i < l; ++i) {
   17         src = arguments[i];
   18         keys(src).forEach(assign);
   19     }
   20     if (error !== undefined) throw error;
   21     return dest;
   22 };