_baseAssignValue.js 625B

1234567891011121314151617181920212223242526
  1. var defineProperty = require('./_defineProperty');
  2. /**
  3. * The base implementation of `assignValue` and `assignMergeValue` without
  4. * value checks.
  5. *
  6. * @private
  7. * @param {Object} object The object to modify.
  8. * @param {string} key The key of the property to assign.
  9. * @param {*} value The value to assign.
  10. */
  11. function baseAssignValue(object, key, value) {
  12. if (key == '__proto__' && defineProperty) {
  13. defineProperty(object, key, {
  14. 'configurable': true,
  15. 'enumerable': true,
  16. 'value': value,
  17. 'writable': true
  18. });
  19. } else {
  20. object[key] = value;
  21. }
  22. }
  23. module.exports = baseAssignValue;