install-error-cause.js 418 B

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