UNPKG

ali.regenerator

Version:

Source transformer enabling ECMAScript 6 generator functions (yield) in JavaScript-of-today (ES5)

29 lines (24 loc) 703 B
/** * Copyright (c) 2014, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * https://raw.github.com/facebook/regenerator/master/LICENSE file. An * additional grant of patent rights can be found in the PATENTS file in * the same directory. */ var hasOwn = Object.prototype.hasOwnProperty; exports.defaults = function(obj) { var len = arguments.length; var extension; for (var i = 1; i < len; ++i) { if ((extension = arguments[i])) { for (var key in extension) { if (hasOwn.call(extension, key) && !hasOwn.call(obj, key)) { obj[key] = extension[key]; } } } } return obj; };