src/error/index.js
function captureStackTrace(error, constructor) {
    if (Error.captureStackTrace) {
        Error.captureStackTrace(error, constructor);
    } else {
        error.stack = new Error().stack;
    }
}
function captureStackTrace(error, constructor) {
    if (Error.captureStackTrace) {
        Error.captureStackTrace(error, constructor);
    } else {
        error.stack = new Error().stack;
    }
}
function captureStackTrace ( error , constructor ) { if ( Error . captureStackTrace ) { Error . captureStackTrace ( error , constructor ) ; } else { error . stack = new Error ( ) . stack ; } }
Error.captureStackTrace is not available in all
environments, so this function wraps an alternative

@param {*} error
@param {*} constructor
Error . captureStackTrace is not available in all environments so this function wraps an alternative