"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/es5-ext/error/custom.js" (8 Mar 2017, 522 Bytes) of archive /windows/misc/atom-windows.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Javascript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 'use strict';
    2 
    3 var assign = require('../object/assign')
    4 
    5   , captureStackTrace = Error.captureStackTrace;
    6 
    7 exports = module.exports = function (message/*, code, ext*/) {
    8     var err = new Error(), code = arguments[1], ext = arguments[2];
    9     if (ext == null) {
   10         if (code && (typeof code === 'object')) {
   11             ext = code;
   12             code = null;
   13         }
   14     }
   15     if (ext != null) assign(err, ext);
   16     err.message = String(message);
   17     if (code != null) err.code = String(code);
   18     if (captureStackTrace) captureStackTrace(err, exports);
   19     return err;
   20 };