├── auto.js ├── Error ├── auto.js ├── index.js ├── shim.js ├── polyfill.js └── implementation.js ├── EvalError ├── auto.js ├── index.js ├── shim.js ├── polyfill.js └── implementation.js ├── RangeError ├── auto.js ├── index.js ├── shim.js ├── polyfill.js └── implementation.js ├── SyntaxError ├── auto.js ├── index.js ├── shim.js ├── polyfill.js └── implementation.js ├── TypeError ├── auto.js ├── index.js ├── shim.js ├── polyfill.js └── implementation.js ├── URIError ├── auto.js ├── index.js ├── shim.js ├── polyfill.js └── implementation.js ├── .npmrc ├── AggregateError ├── auto.js ├── index.js ├── shim.js ├── polyfill.js └── implementation.js ├── ReferenceError ├── auto.js ├── index.js ├── shim.js ├── polyfill.js └── implementation.js ├── index.json ├── .nycrc ├── .github └── workflows │ ├── node-pretest.yml │ ├── rebase.yml │ ├── require-allow-edits.yml │ ├── node-aught.yml │ └── node-tens.yml ├── helpers ├── polyfill.js └── shim.js ├── test ├── implementation.js ├── index.js ├── tests.js └── shimmed.js ├── shim.js ├── .eslintrc ├── LICENSE ├── .gitignore ├── README.md ├── package.json └── CHANGELOG.md /auto.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | require('./shim')(); 4 | -------------------------------------------------------------------------------- /Error/auto.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | require('./shim')(); 4 | -------------------------------------------------------------------------------- /EvalError/auto.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | require('./shim')(); 4 | -------------------------------------------------------------------------------- /RangeError/auto.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | require('./shim')(); 4 | -------------------------------------------------------------------------------- /SyntaxError/auto.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | require('./shim')(); 4 | -------------------------------------------------------------------------------- /TypeError/auto.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | require('./shim')(); 4 | -------------------------------------------------------------------------------- /URIError/auto.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | require('./shim')(); 4 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | package-lock=false 2 | allow-same-version=true 3 | message=v%s 4 | -------------------------------------------------------------------------------- /AggregateError/auto.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | require('./shim')(); 4 | -------------------------------------------------------------------------------- /ReferenceError/auto.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | require('./shim')(); 4 | -------------------------------------------------------------------------------- /Error/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = require('./polyfill')(); 4 | -------------------------------------------------------------------------------- /EvalError/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = require('./polyfill')(); 4 | -------------------------------------------------------------------------------- /RangeError/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = require('./polyfill')(); 4 | -------------------------------------------------------------------------------- /TypeError/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = require('./polyfill')(); 4 | -------------------------------------------------------------------------------- /URIError/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = require('./polyfill')(); 4 | -------------------------------------------------------------------------------- /AggregateError/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = require('./polyfill')(); 4 | -------------------------------------------------------------------------------- /ReferenceError/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = require('./polyfill')(); 4 | -------------------------------------------------------------------------------- /SyntaxError/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = require('./polyfill')(); 4 | -------------------------------------------------------------------------------- /index.json: -------------------------------------------------------------------------------- 1 | [ 2 | "Error", 3 | "AggregateError", 4 | "EvalError", 5 | "RangeError", 6 | "ReferenceError", 7 | "SyntaxError", 8 | "TypeError", 9 | "URIError" 10 | ] 11 | -------------------------------------------------------------------------------- /.nycrc: -------------------------------------------------------------------------------- 1 | { 2 | "all": true, 3 | "check-coverage": false, 4 | "reporter": ["text-summary", "text", "html", "json"], 5 | "exclude": [ 6 | "coverage", 7 | "test" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /Error/shim.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var shimHelper = require('../helpers/shim'); 4 | var getPolyfill = require('./polyfill'); 5 | 6 | module.exports = shimHelper('Error', getPolyfill); 7 | -------------------------------------------------------------------------------- /.github/workflows/node-pretest.yml: -------------------------------------------------------------------------------- 1 | name: 'Tests: pretest/posttest' 2 | 3 | on: [pull_request, push] 4 | 5 | jobs: 6 | tests: 7 | uses: ljharb/actions/.github/workflows/pretest.yml@main 8 | -------------------------------------------------------------------------------- /EvalError/shim.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var shimHelper = require('../helpers/shim'); 4 | var getPolyfill = require('./polyfill'); 5 | 6 | module.exports = shimHelper('EvalError', getPolyfill); 7 | -------------------------------------------------------------------------------- /TypeError/shim.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var shimHelper = require('../helpers/shim'); 4 | var getPolyfill = require('./polyfill'); 5 | 6 | module.exports = shimHelper('TypeError', getPolyfill); 7 | -------------------------------------------------------------------------------- /URIError/shim.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var shimHelper = require('../helpers/shim'); 4 | var getPolyfill = require('./polyfill'); 5 | 6 | module.exports = shimHelper('URIError', getPolyfill); 7 | -------------------------------------------------------------------------------- /RangeError/shim.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var shimHelper = require('../helpers/shim'); 4 | var getPolyfill = require('./polyfill'); 5 | 6 | module.exports = shimHelper('RangeError', getPolyfill); 7 | -------------------------------------------------------------------------------- /SyntaxError/shim.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var shimHelper = require('../helpers/shim'); 4 | var getPolyfill = require('./polyfill'); 5 | 6 | module.exports = shimHelper('SyntaxError', getPolyfill); 7 | -------------------------------------------------------------------------------- /AggregateError/shim.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var shimHelper = require('../helpers/shim'); 4 | var getPolyfill = require('./polyfill'); 5 | 6 | module.exports = shimHelper('AggregateError', getPolyfill); 7 | -------------------------------------------------------------------------------- /ReferenceError/shim.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var shimHelper = require('../helpers/shim'); 4 | var getPolyfill = require('./polyfill'); 5 | 6 | module.exports = shimHelper('ReferenceError', getPolyfill); 7 | -------------------------------------------------------------------------------- /Error/polyfill.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var implementation = require('./implementation'); 4 | var polyfillHelper = require('../helpers/polyfill'); 5 | 6 | module.exports = polyfillHelper(Error, implementation); 7 | -------------------------------------------------------------------------------- /URIError/polyfill.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var polyfillHelper = require('../helpers/polyfill'); 4 | var implementation = require('./implementation'); 5 | 6 | module.exports = polyfillHelper(URIError, implementation); 7 | -------------------------------------------------------------------------------- /EvalError/polyfill.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var implementation = require('./implementation'); 4 | var polyfillHelper = require('../helpers/polyfill'); 5 | 6 | module.exports = polyfillHelper(EvalError, implementation); 7 | -------------------------------------------------------------------------------- /RangeError/polyfill.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var implementation = require('./implementation'); 4 | var polyfillHelper = require('../helpers/polyfill'); 5 | 6 | module.exports = polyfillHelper(RangeError, implementation); 7 | -------------------------------------------------------------------------------- /SyntaxError/polyfill.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var implementation = require('./implementation'); 4 | var polyfillHelper = require('../helpers/polyfill'); 5 | 6 | module.exports = polyfillHelper(SyntaxError, implementation); 7 | -------------------------------------------------------------------------------- /TypeError/polyfill.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var implementation = require('./implementation'); 4 | var polyfillHelper = require('../helpers/polyfill'); 5 | 6 | module.exports = polyfillHelper(TypeError, implementation); 7 | -------------------------------------------------------------------------------- /ReferenceError/polyfill.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var implementation = require('./implementation'); 4 | var polyfillHelper = require('../helpers/polyfill'); 5 | 6 | module.exports = polyfillHelper(ReferenceError, implementation); 7 | -------------------------------------------------------------------------------- /.github/workflows/rebase.yml: -------------------------------------------------------------------------------- 1 | name: Automatic Rebase 2 | 3 | on: [pull_request_target] 4 | 5 | jobs: 6 | _: 7 | uses: ljharb/actions/.github/workflows/rebase.yml@main 8 | secrets: 9 | token: ${{ secrets.GITHUB_TOKEN }} 10 | -------------------------------------------------------------------------------- /.github/workflows/require-allow-edits.yml: -------------------------------------------------------------------------------- 1 | name: Require “Allow Edits” 2 | 3 | on: [pull_request_target] 4 | 5 | jobs: 6 | _: 7 | name: "Require “Allow Edits”" 8 | 9 | runs-on: ubuntu-latest 10 | 11 | steps: 12 | - uses: ljharb/require-allow-edits@main 13 | -------------------------------------------------------------------------------- /AggregateError/polyfill.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var AggregateError = require('es-aggregate-error/polyfill')(); 4 | var implementation = require('./implementation'); 5 | var polyfillHelper = require('../helpers/polyfill'); 6 | 7 | module.exports = polyfillHelper(AggregateError, implementation); 8 | -------------------------------------------------------------------------------- /.github/workflows/node-aught.yml: -------------------------------------------------------------------------------- 1 | name: 'Tests: node.js < 10' 2 | 3 | on: [pull_request, push] 4 | 5 | jobs: 6 | tests: 7 | uses: ljharb/actions/.github/workflows/node.yml@main 8 | with: 9 | range: '< 10' 10 | type: minors 11 | command: npm run tests-only 12 | 13 | node: 14 | name: 'node < 10' 15 | needs: [tests] 16 | runs-on: ubuntu-latest 17 | steps: 18 | - run: 'echo tests completed' 19 | -------------------------------------------------------------------------------- /.github/workflows/node-tens.yml: -------------------------------------------------------------------------------- 1 | name: 'Tests: node.js >= 10' 2 | 3 | on: [pull_request, push] 4 | 5 | jobs: 6 | tests: 7 | uses: ljharb/actions/.github/workflows/node.yml@main 8 | with: 9 | range: '>= 10' 10 | type: minors 11 | command: npm run tests-only 12 | 13 | node: 14 | name: 'node >= 10' 15 | needs: [tests] 16 | runs-on: ubuntu-latest 17 | steps: 18 | - run: 'echo tests completed' 19 | -------------------------------------------------------------------------------- /helpers/polyfill.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function polyfillHelper(C, implementation) { 4 | return function polyfill() { 5 | var options = { cause: { sentinel: true } }; 6 | var e = new C('a', options); 7 | if ( 8 | 'cause' in e 9 | && !('cause' in C.prototype) // https://bugs.chromium.org/p/v8/issues/detail?id=12006 10 | && e.cause === options.cause 11 | ) { 12 | return C; 13 | } 14 | return implementation; 15 | }; 16 | }; 17 | -------------------------------------------------------------------------------- /test/implementation.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var test = require('tape'); 4 | var forEach = require('for-each'); 5 | 6 | var Constructors = require('../'); 7 | var runTests = require('./tests'); 8 | 9 | forEach(Constructors, function (Constructor) { 10 | test(Constructor + ': as a function', function (t) { 11 | var implementation = require('../' + Constructor + '/implementation'); // eslint-disable-line global-require 12 | 13 | runTests(implementation, Constructor, t); 14 | t.end(); 15 | }); 16 | }); 17 | 18 | -------------------------------------------------------------------------------- /shim.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Error = require('./Error/shim'); 4 | var AggregateError = require('./AggregateError/shim'); 5 | var EvalError = require('./EvalError/shim'); 6 | var RangeError = require('./RangeError/shim'); 7 | var ReferenceError = require('./ReferenceError/shim'); 8 | var SyntaxError = require('./SyntaxError/shim'); 9 | var TypeError = require('./TypeError/shim'); 10 | var URIError = require('./URIError/shim'); 11 | 12 | module.exports = function shim() { 13 | Error(); 14 | AggregateError(); 15 | EvalError(); 16 | RangeError(); 17 | ReferenceError(); 18 | SyntaxError(); 19 | TypeError(); 20 | URIError(); 21 | }; 22 | -------------------------------------------------------------------------------- /test/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var test = require('tape'); 4 | var forEach = require('for-each'); 5 | 6 | var constructors = require('../'); 7 | 8 | var runTests = require('./tests'); 9 | 10 | test('Error cause', function (t) { 11 | t.ok(Array.isArray(constructors), 'main export is an array'); 12 | 13 | t.test('constructors', function (st) { 14 | forEach(constructors, function (Constructor) { 15 | var bound = require('../' + Constructor); // eslint-disable-line global-require 16 | 17 | st.test(Constructor + ': as a function', function (s2t) { 18 | runTests(bound, Constructor, s2t); 19 | 20 | s2t.end(); 21 | }); 22 | }); 23 | 24 | st.end(); 25 | }); 26 | 27 | t.end(); 28 | }); 29 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | 4 | "extends": "@ljharb", 5 | 6 | "rules": { 7 | "func-name-matching": "off", 8 | "func-style": "off", 9 | "id-length": "off", 10 | "max-lines-per-function": "off", 11 | "multiline-comment-style": "off", 12 | "new-cap": ["error", { 13 | "capIsNewExceptions": [ 14 | "DefineMethodProperty", 15 | "DefinePropertyOrThrow", 16 | "Get", 17 | "GetIntrinsic", 18 | "HasProperty", 19 | "InstallErrorCause", 20 | "Error", 21 | "AggregateError", 22 | "EvalError", 23 | "RangeError", 24 | "ReferenceError", 25 | "SyntaxError", 26 | "ToString", 27 | "TypeError", 28 | "Type", 29 | "URIError", 30 | ], 31 | }], 32 | }, 33 | } 34 | -------------------------------------------------------------------------------- /helpers/shim.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var define = require('define-properties'); 4 | var globalThis = require('globalthis')(); 5 | var setProto = require('set-proto'); 6 | 7 | var trueThunk = function () { 8 | return true; 9 | }; 10 | 11 | module.exports = function shimHelper(name, getPolyfill) { 12 | return function shim() { 13 | var original = globalThis[name]; 14 | if (original) { 15 | delete original.prototype.cause; // fix a bug in node v16.9's v8 (https://bugs.chromium.org/p/v8/issues/detail?id=12006) 16 | } 17 | 18 | var polyfill = getPolyfill(); 19 | 20 | if (original !== polyfill) { 21 | var o = {}; 22 | o[name] = polyfill; 23 | var p = {}; 24 | p[name] = trueThunk; 25 | define(globalThis, o, p); 26 | 27 | if (setProto && name !== 'Error') { 28 | setProto(polyfill, Error); 29 | } 30 | } 31 | 32 | return polyfill; 33 | }; 34 | }; 35 | -------------------------------------------------------------------------------- /Error/implementation.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var hasPropertyDescriptors = require('has-property-descriptors')(); 4 | var DefineMethodProperty = require('es-abstract/2025/DefineMethodProperty'); 5 | var InstallErrorCause = require('es-abstract/2025/InstallErrorCause'); 6 | var setProto = require('set-proto'); 7 | 8 | var $Error = require('es-errors'); 9 | 10 | function Error(message) { 11 | var O = arguments.length > 1 ? new $Error(message, arguments[1]) : new $Error(message); 12 | 13 | InstallErrorCause(O, arguments.length > 1 && arguments[1]); 14 | 15 | DefineMethodProperty(O, 'constructor', Error, false); 16 | 17 | return O; 18 | } 19 | 20 | if (setProto) { 21 | setProto(Error, $Error); 22 | } 23 | 24 | Error.prototype = $Error.prototype; 25 | if (hasPropertyDescriptors) { 26 | Object.defineProperty(Error, 'prototype', { writable: false }); 27 | } 28 | 29 | module.exports = Error; 30 | -------------------------------------------------------------------------------- /URIError/implementation.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var hasPropertyDescriptors = require('has-property-descriptors')(); 4 | 5 | var $URIError = require('es-errors/uri'); 6 | 7 | var DefineMethodProperty = require('es-abstract/2025/DefineMethodProperty'); 8 | var InstallErrorCause = require('es-abstract/2025/InstallErrorCause'); 9 | var setProto = require('set-proto'); 10 | 11 | var Error = require('../Error/polyfill')(); 12 | 13 | function URIError(message) { 14 | var O = arguments.length > 1 ? new $URIError(message, arguments[1]) : new $URIError(message); 15 | 16 | InstallErrorCause(O, arguments.length > 1 && arguments[1]); 17 | 18 | DefineMethodProperty(O, 'constructor', URIError, false); 19 | 20 | return O; 21 | } 22 | 23 | if (setProto) { 24 | setProto(URIError, Error); 25 | } 26 | 27 | URIError.prototype = $URIError.prototype; 28 | if (hasPropertyDescriptors) { 29 | Object.defineProperty(URIError, 'prototype', { writable: false }); 30 | } 31 | 32 | module.exports = URIError; 33 | -------------------------------------------------------------------------------- /EvalError/implementation.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var hasPropertyDescriptors = require('has-property-descriptors')(); 4 | 5 | var $EvalError = require('es-errors/eval'); 6 | 7 | var DefineMethodProperty = require('es-abstract/2025/DefineMethodProperty'); 8 | var InstallErrorCause = require('es-abstract/2025/InstallErrorCause'); 9 | var setProto = require('set-proto'); 10 | 11 | var Error = require('../Error/polyfill')(); 12 | 13 | function EvalError(message) { 14 | var O = arguments.length > 1 ? new $EvalError(message, arguments[1]) : new $EvalError(message); 15 | 16 | InstallErrorCause(O, arguments.length > 1 && arguments[1]); 17 | 18 | DefineMethodProperty(O, 'constructor', EvalError, false); 19 | 20 | return O; 21 | } 22 | 23 | if (setProto) { 24 | setProto(EvalError, Error); 25 | } 26 | 27 | EvalError.prototype = $EvalError.prototype; 28 | if (hasPropertyDescriptors) { 29 | Object.defineProperty(EvalError, 'prototype', { writable: false }); 30 | } 31 | 32 | module.exports = EvalError; 33 | -------------------------------------------------------------------------------- /TypeError/implementation.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var hasPropertyDescriptors = require('has-property-descriptors')(); 4 | 5 | var $TypeError = require('es-errors/type'); 6 | 7 | var DefineMethodProperty = require('es-abstract/2025/DefineMethodProperty'); 8 | var InstallErrorCause = require('es-abstract/2025/InstallErrorCause'); 9 | var setProto = require('set-proto'); 10 | 11 | var Error = require('../Error/polyfill')(); 12 | 13 | function TypeError(message) { 14 | var O = arguments.length > 1 ? new $TypeError(message, arguments[1]) : new $TypeError(message); 15 | 16 | InstallErrorCause(O, arguments.length > 1 && arguments[1]); 17 | 18 | DefineMethodProperty(O, 'constructor', TypeError, false); 19 | 20 | return O; 21 | } 22 | 23 | if (setProto) { 24 | setProto(TypeError, Error); 25 | } 26 | 27 | TypeError.prototype = $TypeError.prototype; 28 | if (hasPropertyDescriptors) { 29 | Object.defineProperty(TypeError, 'prototype', { writable: false }); 30 | } 31 | 32 | module.exports = TypeError; 33 | -------------------------------------------------------------------------------- /RangeError/implementation.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var hasPropertyDescriptors = require('has-property-descriptors')(); 4 | 5 | var $RangeError = require('es-errors/range'); 6 | 7 | var DefineMethodProperty = require('es-abstract/2025/DefineMethodProperty'); 8 | var InstallErrorCause = require('es-abstract/2025/InstallErrorCause'); 9 | var setProto = require('set-proto'); 10 | 11 | var Error = require('../Error/polyfill')(); 12 | 13 | function RangeError(message) { 14 | var O = arguments.length > 1 ? new $RangeError(message, arguments[1]) : new $RangeError(message); 15 | 16 | InstallErrorCause(O, arguments.length > 1 && arguments[1]); 17 | 18 | DefineMethodProperty(O, 'constructor', RangeError, false); 19 | 20 | return O; 21 | } 22 | 23 | if (setProto) { 24 | setProto(RangeError, Error); 25 | } 26 | 27 | RangeError.prototype = $RangeError.prototype; 28 | if (hasPropertyDescriptors) { 29 | Object.defineProperty(RangeError, 'prototype', { writable: false }); 30 | } 31 | 32 | module.exports = RangeError; 33 | -------------------------------------------------------------------------------- /SyntaxError/implementation.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var hasPropertyDescriptors = require('has-property-descriptors')(); 4 | 5 | var $SyntaxError = require('es-errors/syntax'); 6 | 7 | var DefineMethodProperty = require('es-abstract/2025/DefineMethodProperty'); 8 | var InstallErrorCause = require('es-abstract/2025/InstallErrorCause'); 9 | var setProto = require('set-proto'); 10 | 11 | var Error = require('../Error/polyfill')(); 12 | 13 | function SyntaxError(message) { 14 | var O = arguments.length > 1 ? new $SyntaxError(message, arguments[1]) : new $SyntaxError(message); 15 | 16 | InstallErrorCause(O, arguments.length > 1 && arguments[1]); 17 | 18 | DefineMethodProperty(O, 'constructor', SyntaxError, false); 19 | 20 | return O; 21 | } 22 | 23 | if (setProto) { 24 | setProto(SyntaxError, Error); 25 | } 26 | 27 | SyntaxError.prototype = $SyntaxError.prototype; 28 | if (hasPropertyDescriptors) { 29 | Object.defineProperty(SyntaxError, 'prototype', { writable: false }); 30 | } 31 | 32 | module.exports = SyntaxError; 33 | -------------------------------------------------------------------------------- /ReferenceError/implementation.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var hasPropertyDescriptors = require('has-property-descriptors')(); 4 | 5 | var $ReferenceError = require('es-errors/ref'); 6 | 7 | var DefineMethodProperty = require('es-abstract/2025/DefineMethodProperty'); 8 | var InstallErrorCause = require('es-abstract/2025/InstallErrorCause'); 9 | var setProto = require('set-proto'); 10 | 11 | var Error = require('../Error/polyfill')(); 12 | 13 | function ReferenceError(message) { 14 | var O = arguments.length > 1 ? new $ReferenceError(message, arguments[1]) : new $ReferenceError(message); 15 | 16 | InstallErrorCause(O, arguments.length > 1 && arguments[1]); 17 | 18 | DefineMethodProperty(O, 'constructor', ReferenceError, false); 19 | 20 | return O; 21 | } 22 | 23 | if (setProto) { 24 | setProto(ReferenceError, Error); 25 | } 26 | 27 | ReferenceError.prototype = $ReferenceError.prototype; 28 | if (hasPropertyDescriptors) { 29 | Object.defineProperty(ReferenceError, 'prototype', { writable: false }); 30 | } 31 | 32 | module.exports = ReferenceError; 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 ECMAScript Shims 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /test/tests.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var hasPropertyDescriptors = require('has-property-descriptors')(); 4 | 5 | module.exports = function (Constructor, name, t) { 6 | t.equal(typeof Constructor, 'function', 'constructor is a function'); 7 | t.notOk('cause' in Constructor.prototype, '`cause` is not a property on `' + name + '.prototype`'); 8 | 9 | if (hasPropertyDescriptors) { 10 | t.deepEqual( 11 | Object.getOwnPropertyDescriptor(Constructor, 'prototype'), 12 | { 13 | configurable: false, 14 | enumerable: false, 15 | value: Constructor.prototype, 16 | writable: false 17 | } 18 | ); 19 | } 20 | 21 | var options = { cause: {} }; 22 | var errors = [{}]; 23 | var instance = Constructor.length === 1 ? new Constructor('message', options) : new Constructor(errors, 'message 2', options); 24 | 25 | t.ok(instance instanceof Constructor, name + ' instance is `instanceof ' + name + '`'); 26 | 27 | t.notOk(Object.prototype.propertyIsEnumerable.call(instance, 'constructor'), 'instance has non-enumerable `constructor` property'); 28 | t.ok(Object.prototype.hasOwnProperty.call(instance, 'cause'), 'instance has own `cause` property'); 29 | t.equal(instance.cause, options.cause, name + ' instance has `cause` property matching passed-in cause'); 30 | 31 | if (Constructor.length > 1) { 32 | t.deepEqual(instance.errors, errors); 33 | } 34 | }; 35 | -------------------------------------------------------------------------------- /AggregateError/implementation.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var hasPropertyDescriptors = require('has-property-descriptors')(); 4 | var $AggregateError = require('es-aggregate-error/polyfill')(); 5 | 6 | var setProto = require('set-proto'); 7 | 8 | var DefineMethodProperty = require('es-abstract/2025/DefineMethodProperty'); 9 | var InstallErrorCause = require('es-abstract/2025/InstallErrorCause'); 10 | var ToString = require('es-abstract/2025/ToString'); 11 | 12 | var Error = require('../Error/polyfill')(); 13 | 14 | function AggregateError(errors, message) { 15 | // ensure observable argument validation order 16 | if (!(this instanceof AggregateError)) { 17 | return arguments.length > 2 18 | ? new AggregateError(errors, message, arguments[2]) 19 | : new AggregateError(errors, message); 20 | } 21 | var strMessage = typeof message === 'undefined' ? message : ToString(message); 22 | var options = arguments.length > 2 ? {} : void undefined; 23 | if (arguments.length > 2) { 24 | InstallErrorCause(options, arguments[2]); 25 | } 26 | 27 | var O = arguments.length > 2 28 | ? new $AggregateError(errors, strMessage, options) 29 | : new $AggregateError(errors, strMessage); 30 | 31 | InstallErrorCause(O, options); 32 | 33 | DefineMethodProperty(O, 'constructor', AggregateError, false); 34 | 35 | return O; 36 | } 37 | 38 | if (setProto) { 39 | setProto(AggregateError, Error); 40 | } 41 | 42 | AggregateError.prototype = $AggregateError.prototype; 43 | if (hasPropertyDescriptors) { 44 | Object.defineProperty(AggregateError, 'prototype', { writable: false }); 45 | } 46 | 47 | module.exports = AggregateError; 48 | -------------------------------------------------------------------------------- /test/shimmed.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var originals = { 4 | Error: Error, 5 | AggregateError: typeof AggregateError === 'undefined' ? undefined : AggregateError, 6 | EvalError: EvalError, 7 | RangeError: RangeError, 8 | ReferenceError: ReferenceError, 9 | SyntaxError: SyntaxError, 10 | TypeError: TypeError, 11 | URIError: URIError 12 | }; 13 | 14 | require('../auto'); 15 | 16 | var test = require('tape'); 17 | var forEach = require('for-each'); 18 | var defineProperties = require('define-properties'); 19 | var globalThis = require('globalthis')(); 20 | var functionName = require('function.prototype.name'); 21 | var isEnumerable = Object.prototype.propertyIsEnumerable; 22 | var functionsHaveNames = require('functions-have-names')(); 23 | 24 | var constructors = require('../'); 25 | var runTests = require('./tests'); 26 | 27 | forEach(constructors, function (Constructor) { 28 | test(Constructor + ': shimmed', function (t) { 29 | t.match(String(globalThis[Constructor].length), /^1|2$/, Constructor + ' has a length of 1 or 2'); 30 | 31 | t.test(Constructor + ': function name', { skip: !functionsHaveNames }, function (st) { 32 | st.equal(globalThis[Constructor].name, Constructor, Constructor + ' has name "' + Constructor + '"'); 33 | st.end(); 34 | }); 35 | 36 | t.test(Constructor + ': enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) { 37 | et.equal(false, isEnumerable.call(globalThis, Constructor), 'globalThis.' + Constructor + ' is not enumerable'); 38 | et.end(); 39 | }); 40 | 41 | runTests(globalThis[Constructor], Constructor, t); 42 | 43 | if (originals[Constructor]) { 44 | t.ok( 45 | new originals[Constructor]([]) instanceof globalThis[Constructor], 46 | 'instance of original `' + functionName(originals[Constructor]) + '` is `instanceof` new ' + Constructor 47 | ); 48 | } 49 | 50 | if (Constructor !== 'Error') { 51 | var instance = new globalThis[Constructor]([]); 52 | t.ok(instance instanceof originals.Error, Constructor + ' instance is `instanceof` original `Error`'); 53 | t.ok(instance instanceof globalThis.Error, Constructor + ' instance is `instanceof` current global `Error`'); 54 | } 55 | 56 | t.end(); 57 | }); 58 | }); 59 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.test 74 | 75 | # parcel-bundler cache (https://parceljs.org/) 76 | .cache 77 | 78 | # Next.js build output 79 | .next 80 | 81 | # Nuxt.js build / generate output 82 | .nuxt 83 | dist 84 | 85 | # Gatsby files 86 | .cache/ 87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 88 | # https://nextjs.org/blog/next-9-1#public-directory-support 89 | # public 90 | 91 | # vuepress build output 92 | .vuepress/dist 93 | 94 | # Serverless directories 95 | .serverless/ 96 | 97 | # FuseBox cache 98 | .fusebox/ 99 | 100 | # DynamoDB Local files 101 | .dynamodb/ 102 | 103 | # TernJS port file 104 | .tern-port 105 | 106 | # Only apps should have lockfiles 107 | npm-shrinkwrap.json 108 | package-lock.json 109 | yarn.lock 110 | 111 | .npmignore 112 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # error-cause [![Version Badge][npm-version-svg]][package-url] 2 | 3 | [![github actions][actions-image]][actions-url] 4 | [![coverage][codecov-image]][codecov-url] 5 | [![dependency status][deps-svg]][deps-url] 6 | [![dev dependency status][dev-deps-svg]][dev-deps-url] 7 | [![License][license-image]][license-url] 8 | [![Downloads][downloads-image]][downloads-url] 9 | 10 | [![npm badge][npm-badge-png]][package-url] 11 | 12 | An ES-spec-compliant shim/polyfill/replacement for the `.cause` property on all Error types that works as far down as ES3 13 | 14 | This package implements the [es-shim API](https://github.com/es-shims/api) “multi” interface. It works in an ES3-supported environment and complies with the proposed [spec](https://tc39.es/proposal-error-cause/). 15 | 16 | ## Getting started 17 | 18 | ```sh 19 | npm install --save error-cause 20 | ``` 21 | 22 | ## Usage/Examples 23 | 24 | ```js 25 | const assert = require('assert'); 26 | 27 | require('error-cause/auto'); 28 | 29 | try { 30 | x(); 31 | } catch (e) { 32 | const actual = new Error('a better message!', { cause: e }); 33 | assert(actual instanceof Error); 34 | assert(actual.cause === e); 35 | } 36 | ``` 37 | 38 | ## Tests 39 | 40 | Clone the repo, `npm install`, and run `npm test` 41 | 42 | [package-url]: https://npmjs.org/package/error-cause 43 | [npm-version-svg]: https://versionbadg.es/es-shims/error-cause.svg 44 | [deps-svg]: https://david-dm.org/es-shims/error-cause.svg 45 | [deps-url]: https://david-dm.org/es-shims/error-cause 46 | [dev-deps-svg]: https://david-dm.org/es-shims/error-cause/dev-status.svg 47 | [dev-deps-url]: https://david-dm.org/es-shims/error-cause#info=devDependencies 48 | [npm-badge-png]: https://nodei.co/npm/error-cause.png?downloads=true&stars=true 49 | [license-image]: https://img.shields.io/npm/l/error-cause.svg 50 | [license-url]: LICENSE 51 | [downloads-image]: https://img.shields.io/npm/dm/error-cause.svg 52 | [downloads-url]: https://npm-stat.com/charts.html?package=error-cause 53 | [codecov-image]: https://codecov.io/gh/es-shims/error-cause/branch/main/graphs/badge.svg 54 | [codecov-url]: https://app.codecov.io/gh/es-shims/error-cause/ 55 | [actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/error-cause 56 | [actions-url]: https://github.com/es-shims/error-cause/actions 57 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "error-cause", 3 | "version": "1.0.9", 4 | "description": "An ES-spec-compliant shim/polyfill/replacement for the `.cause` property on all Error types that works as far down as ES3", 5 | "main": "index.json", 6 | "exports": { 7 | ".": "./index.json", 8 | "./auto": "./auto.js", 9 | "./shim": "./shim.js", 10 | "./AggregateError": "./AggregateError/index.js", 11 | "./AggregateError/auto": "./AggregateError/auto.js", 12 | "./AggregateError/polyfill": "./AggregateError/polyfill.js", 13 | "./AggregateError/implementation": "./AggregateError/implementation.js", 14 | "./AggregateError/shim": "./AggregateError/shim.js", 15 | "./Error": "./Error/index.js", 16 | "./Error/auto": "./Error/auto.js", 17 | "./Error/polyfill": "./Error/polyfill.js", 18 | "./Error/implementation": "./Error/implementation.js", 19 | "./Error/shim": "./Error/shim.js", 20 | "./EvalError": "./EvalError/index.js", 21 | "./EvalError/auto": "./EvalError/auto.js", 22 | "./EvalError/polyfill": "./EvalError/polyfill.js", 23 | "./EvalError/implementation": "./EvalError/implementation.js", 24 | "./EvalError/shim": "./EvalError/shim.js", 25 | "./RangeError": "./RangeError/index.js", 26 | "./RangeError/auto": "./RangeError/auto.js", 27 | "./RangeError/polyfill": "./RangeError/polyfill.js", 28 | "./RangeError/implementation": "./RangeError/implementation.js", 29 | "./RangeError/shim": "./RangeError/shim.js", 30 | "./ReferenceError": "./ReferenceError/index.js", 31 | "./ReferenceError/auto": "./ReferenceError/auto.js", 32 | "./ReferenceError/polyfill": "./ReferenceError/polyfill.js", 33 | "./ReferenceError/implementation": "./ReferenceError/implementation.js", 34 | "./ReferenceError/shim": "./ReferenceError/shim.js", 35 | "./SyntaxError": "./SyntaxError/index.js", 36 | "./SyntaxError/auto": "./SyntaxError/auto.js", 37 | "./SyntaxError/polyfill": "./SyntaxError/polyfill.js", 38 | "./SyntaxError/implementation": "./SyntaxError/implementation.js", 39 | "./SyntaxError/shim": "./SyntaxError/shim.js", 40 | "./TypeError": "./TypeError/index.js", 41 | "./TypeError/auto": "./TypeError/auto.js", 42 | "./TypeError/polyfill": "./TypeError/polyfill.js", 43 | "./TypeError/implementation": "./TypeError/implementation.js", 44 | "./TypeError/shim": "./TypeError/shim.js", 45 | "./URIError": "./URIError/index.js", 46 | "./URIError/auto": "./URIError/auto.js", 47 | "./URIError/polyfill": "./URIError/polyfill.js", 48 | "./URIError/implementation": "./URIError/implementation.js", 49 | "./URIError/shim": "./URIError/shim.js", 50 | "./package.json": "./package.json" 51 | }, 52 | "scripts": { 53 | "prepack": "npmignore --auto --commentLines=autogenerated", 54 | "prepublishOnly": "safe-publish-latest", 55 | "prepublish": "not-in-publish || npm run prepublishOnly", 56 | "prelint": "evalmd README.md", 57 | "lint": "eslint --ext=js,mjs .", 58 | "postlint": "es-shim-api --multi", 59 | "tests-only": "nyc tape 'test/**/*.js'", 60 | "pretest": "npm run lint", 61 | "test": "npm run tests-only", 62 | "posttest": "npx npm@\">= 10.2\" audit --production", 63 | "version": "auto-changelog && git add CHANGELOG.md", 64 | "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" 65 | }, 66 | "repository": { 67 | "type": "git", 68 | "url": "git+https://github.com/es-shims/error-cause.git" 69 | }, 70 | "keywords": [ 71 | "javascript", 72 | "polyfill", 73 | "ecmascript", 74 | "error", 75 | "shim", 76 | "syntaxerror", 77 | "typeerror", 78 | "referenceerror", 79 | "aggregateerror", 80 | "rangeerror", 81 | "evalerror", 82 | "urierror" 83 | ], 84 | "author": "Jordan Harband ", 85 | "license": "MIT", 86 | "bugs": { 87 | "url": "https://github.com/es-shims/error-cause/issues" 88 | }, 89 | "homepage": "https://github.com/es-shims/error-cause#readme", 90 | "dependencies": { 91 | "call-bind": "^1.0.8", 92 | "define-properties": "^1.2.1", 93 | "es-abstract": "^1.24.0", 94 | "es-aggregate-error": "^1.0.14", 95 | "es-errors": "^1.3.0", 96 | "globalthis": "^1.0.4", 97 | "has-property-descriptors": "^1.0.2", 98 | "set-proto": "^1.0.0" 99 | }, 100 | "devDependencies": { 101 | "@es-shims/api": "^2.5.1", 102 | "@ljharb/eslint-config": "^21.2.0", 103 | "auto-changelog": "^2.5.0", 104 | "encoding": "^0.1.13", 105 | "eslint": "=8.8.0", 106 | "evalmd": "^0.0.19", 107 | "function.prototype.name": "^1.1.8", 108 | "has-strict-mode": "^1.1.0", 109 | "in-publish": "^2.0.1", 110 | "npmignore": "^0.3.1", 111 | "nyc": "^10.3.2", 112 | "safe-publish-latest": "^2.0.0", 113 | "tape": "^5.9.0" 114 | }, 115 | "engines": { 116 | "node": ">= 0.4" 117 | }, 118 | "auto-changelog": { 119 | "output": "CHANGELOG.md", 120 | "template": "keepachangelog", 121 | "unreleased": false, 122 | "commitLimit": false, 123 | "backfillLimit": false, 124 | "hideCredit": true 125 | }, 126 | "publishConfig": { 127 | "ignore": [ 128 | ".github/workflows" 129 | ] 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) 6 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 7 | 8 | ## [v1.0.9](https://github.com/es-shims/error-cause/compare/v1.0.8...v1.0.9) - 2025-09-11 9 | 10 | ### Commits 11 | 12 | - [Deps] update `call-bind`, `es-abstract`, `es-aggregate-error`, `globalthis` [`e66973b`](https://github.com/es-shims/error-cause/commit/e66973bae6d18fdcfa0cc9d7dc2dacd38296efa8) 13 | - [Refactor] use `set-proto` directly [`d7088f9`](https://github.com/es-shims/error-cause/commit/d7088f963afedd03d12a6e3fcfe15e729bfae7c8) 14 | - [meta] fix `exports` order [`792d2c6`](https://github.com/es-shims/error-cause/commit/792d2c6993c6bb6c47da52f3de2982c8cf98481c) 15 | - [Dev Deps] update `@es-shims/api`, `@ljharb/eslint-config`, `auto-changelog`, `function.prototype.name`, `has-strict-mode`, `tape` [`04aa4c8`](https://github.com/es-shims/error-cause/commit/04aa4c84b4c191ba9104275bafd9f47017f4a339) 16 | - [Deps] update `es-abstract`, `es-aggregate-error` [`9642253`](https://github.com/es-shims/error-cause/commit/964225373f9905379993accc48eea9d8949904ad) 17 | - [Tests] replace `aud` with `npm audit` [`515c834`](https://github.com/es-shims/error-cause/commit/515c834fc244011a66884ac92adeb3d511a02bed) 18 | - [Dev Deps] update `@es-shims/api` [`553aca0`](https://github.com/es-shims/error-cause/commit/553aca0ebba84efe2886692602d1638cc03d9765) 19 | - [Dev Deps] add missing peer dep [`647a9ba`](https://github.com/es-shims/error-cause/commit/647a9ba70b49d85ed13b889605684f7b8bbb9e23) 20 | 21 | ## [v1.0.8](https://github.com/es-shims/error-cause/compare/v1.0.7...v1.0.8) - 2024-03-16 22 | 23 | ### Commits 24 | 25 | - [Deps] update `call-bind`, `es-abstract`, `has-property-descriptors` [`f32d2c2`](https://github.com/es-shims/error-cause/commit/f32d2c2c922ea48ca56cf8c19768143c8670c1f2) 26 | - [Dev Deps] update `tape` [`8306def`](https://github.com/es-shims/error-cause/commit/8306defb4dfed92c18e4275fda4983636ee507bb) 27 | 28 | ## [v1.0.7](https://github.com/es-shims/error-cause/compare/v1.0.6...v1.0.7) - 2024-02-05 29 | 30 | ### Commits 31 | 32 | - [Refactor] use `es-errors` where possible, so things that only need those do not need `get-intrinsic` [`594cdae`](https://github.com/es-shims/error-cause/commit/594cdaef3d6509c4044bf60fb6309cc9585ca3d7) 33 | - [Deps] update `call-bind`, `define-properties`, `es-abstract`, `es-aggregate-error`, `get-intrinsic`, `has-property-descriptors` [`2353b34`](https://github.com/es-shims/error-cause/commit/2353b346dd8373b28c579bb5b4d78e8a7d903bae) 34 | - [Dev Deps] update `aud`, `function.prototype.name`, `npmignore`, `tape` [`d9d2cb7`](https://github.com/es-shims/error-cause/commit/d9d2cb7c8d01109c36531a9a089adf83be15ce3c) 35 | 36 | ## [v1.0.6](https://github.com/es-shims/error-cause/compare/v1.0.5...v1.0.6) - 2023-08-27 37 | 38 | ### Commits 39 | 40 | - [Deps] update `define-properties`, `es-abstract`, `es-aggregate-error`, `get-intrinsic` [`838666c`](https://github.com/es-shims/error-cause/commit/838666cdf77f06762e62225e461211610c4b6e73) 41 | - [Dev Deps] update `@es-shims/api`, `@ljharb/eslint-config`, `aud`, `tape` [`a2ae385`](https://github.com/es-shims/error-cause/commit/a2ae385d9b581467abc494d1d06afc730eed4e34) 42 | 43 | ## [v1.0.5](https://github.com/es-shims/error-cause/compare/v1.0.4...v1.0.5) - 2022-11-07 44 | 45 | ### Commits 46 | 47 | - [Deps] update `es-abstract`, `es-aggregate-error`, `get-intrinsic`, `globalthis` [`7674ed8`](https://github.com/es-shims/error-cause/commit/7674ed8e051e1d4642637a8059858fbffd419d2e) 48 | - [actions] update rebase action to use reusable workflow [`3035aa1`](https://github.com/es-shims/error-cause/commit/3035aa15d67a72aeb6d1238f295e1d4eb09177ba) 49 | - [Dev Deps] update `aud`, `tape` [`65cb74b`](https://github.com/es-shims/error-cause/commit/65cb74b81cd7c74c5e446cf133b4a2d3fe2f735d) 50 | 51 | ## [v1.0.4](https://github.com/es-shims/error-cause/compare/v1.0.3...v1.0.4) - 2022-05-04 52 | 53 | ### Commits 54 | 55 | - [meta] use `npmignore` to autogenerate an npmignore file [`4172ae5`](https://github.com/es-shims/error-cause/commit/4172ae5400db22cb14d227a317073f4c052dd6a6) 56 | - [Fix] ensure constructor prototypes are nonwritable [`735bfa3`](https://github.com/es-shims/error-cause/commit/735bfa3a493bc14783755f742c5501eff7b8b5e4) 57 | - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `auto-changelog`, `tape` [`1d472b6`](https://github.com/es-shims/error-cause/commit/1d472b657ac83621d57860ed699ed9ebec68fcea) 58 | - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`8042125`](https://github.com/es-shims/error-cause/commit/8042125497714ec5087e0ec35ada2bb810320ede) 59 | - [patch] add comment for v8 bug [`6924f48`](https://github.com/es-shims/error-cause/commit/6924f485637d9d535e19e7bf36f9e3d9e189d5af) 60 | - [Deps] update `define-properties`, `es-abstract` [`69fc186`](https://github.com/es-shims/error-cause/commit/69fc1861856fe2d02336d64e882f8b0e4c259296) 61 | 62 | ## [v1.0.3](https://github.com/es-shims/error-cause/compare/v1.0.2...v1.0.3) - 2021-12-17 63 | 64 | ### Commits 65 | 66 | - [Fix] `constructor` property must be non-enumerable [`a1de915`](https://github.com/es-shims/error-cause/commit/a1de9150adf8efbda01468122297fc6098d88a04) 67 | - [Dev Deps] update `eslint`, `@ljharb/eslint-config` [`0bb890a`](https://github.com/es-shims/error-cause/commit/0bb890a363e27ad165da77901689c74d44521908) 68 | 69 | ## [v1.0.2](https://github.com/es-shims/error-cause/compare/v1.0.1...v1.0.2) - 2021-12-05 70 | 71 | ### Commits 72 | 73 | - [actions] reuse common workflows [`a2a7c51`](https://github.com/es-shims/error-cause/commit/a2a7c511de2d38328798301199f1ec993665feb1) 74 | - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `tape` [`b28b1b2`](https://github.com/es-shims/error-cause/commit/b28b1b2960f15e234bbfaabfffeaa509b0ff47b7) 75 | - [actions] update codecov uploader [`77dd54f`](https://github.com/es-shims/error-cause/commit/77dd54f71f220fd65bcc8f7708de3e96248451d6) 76 | - [Deps] move `evalmd` to dev dependency [`7079c9d`](https://github.com/es-shims/error-cause/commit/7079c9d4556f307dc707dfa08118bfc8f96484ed) 77 | 78 | ## [v1.0.1](https://github.com/es-shims/error-cause/compare/v1.0.0...v1.0.1) - 2021-10-04 79 | 80 | ### Fixed 81 | 82 | - [readme] use an actual Error as the cause [`#2`](https://github.com/es-shims/error-cause/issues/2) 83 | 84 | ### Commits 85 | 86 | - [meta] add missing "exports" entries [`b8cf2da`](https://github.com/es-shims/error-cause/commit/b8cf2da2ddc435524eff45aa32ad1dd76d03dc2e) 87 | - [Deps] update `es-abstract`, `es-aggregate-error` [`b87af6f`](https://github.com/es-shims/error-cause/commit/b87af6f2a7616dc06ec4f8c9ad6b27710d04b7f2) 88 | - [Tests] add `@es-shims/api` [`05ff5db`](https://github.com/es-shims/error-cause/commit/05ff5db398b4771ec8681613e5d94a841c758d53) 89 | - [Dev Deps] update `function.prototype.name` [`b212d83`](https://github.com/es-shims/error-cause/commit/b212d83895d98f4185679d6f181aef94d65dc543) 90 | 91 | ## v1.0.0 - 2021-09-23 92 | 93 | ### Commits 94 | 95 | - Initial implementation and tests [`8a81cd5`](https://github.com/es-shims/error-cause/commit/8a81cd5fc6de00cd39c06959f831dada8ce15146) 96 | - Initial commit [`086d163`](https://github.com/es-shims/error-cause/commit/086d163a8c42858499ad42c4ca5bb9203bed8b68) 97 | - readme [`39003e7`](https://github.com/es-shims/error-cause/commit/39003e736fe7ae57a3287833262626926a969d61) 98 | - npm init [`446190a`](https://github.com/es-shims/error-cause/commit/446190a1e9ccb485ac69ef15b71c2c9dc14b62c9) 99 | - [meta] add `auto-changelog` [`535363e`](https://github.com/es-shims/error-cause/commit/535363e463ddf8dfc823d63c3e63288780e1e2f2) 100 | - Only apps should have lockfiles [`be790ab`](https://github.com/es-shims/error-cause/commit/be790abc5b78c21014ab6ecf4412cd4da242f1f0) 101 | - [meta] add `safe-publish-latest` [`f4f69a2`](https://github.com/es-shims/error-cause/commit/f4f69a2e6de3ae820ad8aa20abb3e63697c4a382) 102 | --------------------------------------------------------------------------------