UNPKG

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