main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
976 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | 'use strict';
|
---|
| 2 | var $ = require('../internals/export');
|
---|
| 3 | var getBuiltIn = require('../internals/get-built-in');
|
---|
| 4 | var apply = require('../internals/function-apply');
|
---|
| 5 | var fails = require('../internals/fails');
|
---|
| 6 | var wrapErrorConstructorWithCause = require('../internals/wrap-error-constructor-with-cause');
|
---|
| 7 |
|
---|
| 8 | var AGGREGATE_ERROR = 'AggregateError';
|
---|
| 9 | var $AggregateError = getBuiltIn(AGGREGATE_ERROR);
|
---|
| 10 |
|
---|
| 11 | var FORCED = !fails(function () {
|
---|
| 12 | return $AggregateError([1]).errors[0] !== 1;
|
---|
| 13 | }) && fails(function () {
|
---|
| 14 | return $AggregateError([1], AGGREGATE_ERROR, { cause: 7 }).cause !== 7;
|
---|
| 15 | });
|
---|
| 16 |
|
---|
| 17 | // https://tc39.es/ecma262/#sec-aggregate-error
|
---|
| 18 | $({ global: true, constructor: true, arity: 2, forced: FORCED }, {
|
---|
| 19 | AggregateError: wrapErrorConstructorWithCause(AGGREGATE_ERROR, function (init) {
|
---|
| 20 | // eslint-disable-next-line no-unused-vars -- required for functions `.length`
|
---|
| 21 | return function AggregateError(errors, message) { return apply(init, this, arguments); };
|
---|
| 22 | }, FORCED, true)
|
---|
| 23 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.