Sha256: 64d192d516e916e52c1da2f28eb7038469e036f6ac6b2da84c3673eef2fef7e5

Contents?: true

Size: 1.79 KB

Versions: 13

Compression:

Stored size: 1.79 KB

Contents

'use strict';
var $ = require('../internals/export');
var DESCRIPTORS = require('../internals/descriptors');
var getPrototypeOf = require('../internals/object-get-prototype-of');
var setPrototypeOf = require('../internals/object-set-prototype-of');
var create = require('../internals/object-create');
var defineProperty = require('../internals/object-define-property');
var createPropertyDescriptor = require('../internals/create-property-descriptor');
var iterate = require('../internals/iterate');
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
var InternalStateModule = require('../internals/internal-state');

var setInternalState = InternalStateModule.set;
var getInternalAggregateErrorState = InternalStateModule.getterFor('AggregateError');

var $AggregateError = function AggregateError(errors, message) {
  var that = this;
  if (!(that instanceof $AggregateError)) return new $AggregateError(errors, message);
  if (setPrototypeOf) {
    that = setPrototypeOf(new Error(message), getPrototypeOf(that));
  }
  var errorsArray = [];
  iterate(errors, errorsArray.push, errorsArray);
  if (DESCRIPTORS) setInternalState(that, { errors: errorsArray, type: 'AggregateError' });
  else that.errors = errorsArray;
  if (message !== undefined) createNonEnumerableProperty(that, 'message', String(message));
  return that;
};

$AggregateError.prototype = create(Error.prototype, {
  constructor: createPropertyDescriptor(5, $AggregateError),
  message: createPropertyDescriptor(5, ''),
  name: createPropertyDescriptor(5, 'AggregateError')
});

if (DESCRIPTORS) defineProperty.f($AggregateError.prototype, 'errors', {
  get: function () {
    return getInternalAggregateErrorState(this).errors;
  },
  configurable: true
});

$({ global: true }, {
  AggregateError: $AggregateError
});

Version data entries

13 entries across 13 versions & 4 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/core-js/modules/esnext.aggregate-error.js
tang-0.2.1 spec/tang_app/node_modules/core-js/modules/esnext.aggregate-error.js
tang-0.2.0 spec/tang_app/node_modules/core-js/modules/esnext.aggregate-error.js
tang-0.1.0 spec/tang_app/node_modules/core-js/modules/esnext.aggregate-error.js
tang-0.0.9 spec/tang_app/node_modules/core-js/modules/esnext.aggregate-error.js
enju_library-0.3.8 spec/dummy/node_modules/core-js/modules/esnext.aggregate-error.js
condenser-0.3 lib/condenser/processors/node_modules/core-js-pure/modules/esnext.aggregate-error.js
condenser-0.2 lib/condenser/processors/node_modules/core-js-pure/modules/esnext.aggregate-error.js
condenser-0.1 lib/condenser/processors/node_modules/core-js-pure/modules/esnext.aggregate-error.js
condenser-0.0.12 lib/condenser/processors/node_modules/core-js-pure/modules/esnext.aggregate-error.js
condenser-0.0.11 lib/condenser/processors/node_modules/core-js-pure/modules/esnext.aggregate-error.js
condenser-0.0.10 lib/condenser/processors/node_modules/core-js-pure/modules/esnext.aggregate-error.js
condenser-0.0.9 lib/condenser/processors/node_modules/core-js-pure/modules/esnext.aggregate-error.js