_relativize_error(error, compiled, self = true) {
        // Stringify error and convert backslashes to forward slashes to support Windows
        let error_string = typeof error !== 'string' ? error.toString() : error;
        error_string = error_string.split('\\').join('/'); // Replace all backwards slashes with forward slash

        let reference = this;
        let path_data = this._path_data(self);
        let compiled_chunks = compiled.split('\n');
        let error_chunks = error_string.split('\n');
        for (let i = 0; i < error_chunks.length; i++) {
            let current = error_chunks[i];
            let error_line = reference._error_line(current, path_data.name);
            if (error_line) {
                current = current.split(' ');

                // Attempt to only overwrite chunk with path and preserve as much content in current line as possible
                for (let cx = 0; cx < current.length; cx++) {
                    let cx_current = current[cx];
                    let error_line = reference._error_line(
                        cx_current,
                        path_data.name
                    );

                    if (error_line) {
                        let relative_file = reference._relative_file(
                            error_line,
                            compiled_chunks
                        );

                        if (relative_file) {
                            // Replace current trace with absolute relativized trace
                            let absolute_trace = `[${Path.resolve(
                                relative_file.path
                            )}:${relative_file.relative_line}]`;
                            current[cx] = absolute_trace;
                        }
                    }
                }

                error_chunks[i] = current.join(' ');
            }
        }

        return error_chunks.join('\n');
    }
/**
     * INTERNAL METHOD!
     * Logs provided error with a relativized stack trace.
     *
     * @param {Error} error
     * @param {String} compiled
     * @param {Boolean} self
     */
INTERNAL METHOD.
Logs provided error with a relativized stack trace.


INTERNAL METHOD . Logs provided error with a relativized stack trace .
_relativize_error(error, compiled, self = true) {
        let error_string = typeof error !== 'string' ? error.toString() : error;
        error_string = error_string.split('\\').join('/'); 
        let reference = this;
        let path_data = this._path_data(self);
        let compiled_chunks = compiled.split('\n');
        let error_chunks = error_string.split('\n');
        for (let i = 0; i < error_chunks.length; i++) {
            let current = error_chunks[i];
            let error_line = reference._error_line(current, path_data.name);
            if (error_line) {
                current = current.split(' ');
                for (let cx = 0; cx < current.length; cx++) {
                    let cx_current = current[cx];
                    let error_line = reference._error_line(
                        cx_current,
                        path_data.name
                    );
                    if (error_line) {
                        let relative_file = reference._relative_file(
                            error_line,
                            compiled_chunks
                        );
                        if (relative_file) {
                            let absolute_trace = `[${Path.resolve(
                                relative_file.path
                            )}:${relative_file.relative_line}]`;
                            current[cx] = absolute_trace;
                        }
                    }
                }
                error_chunks[i] = current.join(' ');
            }
        }
        return error_chunks.join('\n');
    }
_relativize_error ( error , compiled , self = true ) { let error_string = typeof error !== 'string' ? error . toString ( ) : error ; error_string = error_string . split ( '\\' ) . join ( '/' ) ; let reference = this ; let path_data = this . _path_data ( self ) ; let compiled_chunks = compiled . split ( '\n' ) ; let error_chunks = error_string . split ( '\n' ) ; for ( let i = 0 ; i < error_chunks . length ; i ++ ) { let current = error_chunks [ i ] ; let error_line = reference . _error_line ( current , path_data . name ) ; if ( error_line ) { current = current . split ( ' ' ) ; for ( let cx = 0 ; cx < current . length ; cx ++ ) { let cx_current = current [ cx ] ; let error_line = reference . _error_line ( cx_current , path_data . name ) ; if ( error_line ) { let relative_file = reference . _relative_file ( error_line , compiled_chunks ) ; if ( relative_file ) { let absolute_trace = ` ${ Path . resolve ( relative_file . path ) } ${ relative_file . relative_line } ` ; current [ cx ] = absolute_trace ; } } } error_chunks [ i ] = current . join ( ' ' ) ; } } return error_chunks . join ( '\n' ) ; }
INTERNAL METHOD!
INTERNAL METHOD!
// Stringify error and convert backslashes to forward slashes to support Windows // Replace all backwards slashes with forward slash // Attempt to only overwrite chunk with path and preserve as much content in current line as possible // Replace current trace with absolute relativized trace