install-error-cause.js 432 B

1234567891011
  1. 'use strict';
  2. var isObject = require('../internals/is-object');
  3. var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
  4. // `InstallErrorCause` abstract operation
  5. // https://tc39.es/proposal-error-cause/#sec-errorobjects-install-error-cause
  6. module.exports = function (O, options) {
  7. if (isObject(options) && 'cause' in options) {
  8. createNonEnumerableProperty(O, 'cause', options.cause);
  9. }
  10. };