Abstract
Static
Fix the prototype chain of the error
Use Object.setPrototypeOf Support ES6 environments
Fallback setting proto Support IE11+, see https://docs.microsoft.com/en-us/scripting/javascript/reference/javascript-version-information
Capture and fix the error stack when available
Use Error.captureStackTrace Support v8 environments
Fix the prototype chain of the error
Use Object.setPrototypeOf Support ES6 environments
Fallback setting proto Support IE11+, see https://docs.microsoft.com/en-us/scripting/javascript/reference/javascript-version-information