-
-
Save faust45/664223 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var error = new Error; | |
Object.defineProperty(global, '__stack', { | |
get: function(){ | |
Error.prepareStackTrace = function(err, frames){ | |
err.frames = frames; | |
}; | |
try { | |
throw error; | |
} catch (err) { | |
Error.captureStackTrace(err, arguments.callee); | |
err.stack; | |
delete Error.prepareStackTrace; | |
return err.frames; | |
} | |
} | |
}); | |
(function foo(){ | |
(function bar(){ | |
(function baz(){ | |
console.log(__stack); | |
})(); | |
})(); | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// .js for highlighting :) | |
[ { receiver: {}, fun: [Function: baz], pos: 497 } | |
, { receiver: [Circular] | |
, fun: [Function: bar] | |
, pos: 524 | |
} | |
, { receiver: [Circular] | |
, fun: [Function: foo] | |
, pos: 532 | |
} | |
, { receiver: {}, fun: [Function], pos: 538 } | |
, { receiver: | |
{ id: '.' | |
, exports: [Circular] | |
, parent: undefined | |
, moduleCache: {} | |
, filename: '/Users/tj/Testing/js/stack.js' | |
, loaded: false | |
, exited: false | |
, children: [] | |
} | |
, fun: [Function] | |
, pos: 13407 | |
} | |
, { receiver: [Circular], fun: [Function], pos: 13629 } | |
, { receiver: [Circular], fun: [Function], pos: 10165 } | |
, { receiver: | |
{ requireNative: [Function: requireNative] | |
, runMain: [Function] | |
} | |
, fun: [Function] | |
, pos: 14938 | |
} | |
, { receiver: [ [Function] ] | |
, fun: [Function] | |
, pos: 20839 | |
} | |
, { receiver: | |
{ title: 'node' | |
, global: [Circular] | |
, version: 'v0.2.3' | |
, installPrefix: '/usr/local' | |
, versions: [Object] | |
, platform: 'darwin' | |
, ARGV: [Object] | |
, argv: [Circular] | |
, ENV: [Object] | |
, env: [Circular] | |
, pid: 5885 | |
, execPath: '/usr/local/bin/node' | |
, loop: [Function] | |
, unloop: [Function] | |
, compile: [Function] | |
, _byteLength: [Function] | |
, _needTickCallback: [Function] | |
, reallyExit: [Function] | |
, chdir: [Function] | |
, cwd: [Function] | |
, getuid: [Function] | |
, setuid: [Function] | |
, setgid: [Function] | |
, getgid: [Function] | |
, umask: [Function] | |
, dlopen: [Function] | |
, kill: [Function] | |
, memoryUsage: [Function] | |
, binding: [Function] | |
, EventEmitter: [Function: EventEmitter] | |
, IOWatcher: [Function: IOWatcher] | |
, Timer: [Function: Timer] | |
, EV_MINPRI: -2 | |
, EV_MAXPRI: 2 | |
, O_RDONLY: 0 | |
, O_WRONLY: 1 | |
, O_RDWR: 2 | |
, S_IFMT: 61440 | |
, S_IFREG: 32768 | |
, S_IFDIR: 16384 | |
, S_IFCHR: 8192 | |
, S_IFBLK: 24576 | |
, S_IFIFO: 4096 | |
, S_IFLNK: 40960 | |
, S_IFSOCK: 49152 | |
, O_CREAT: 512 | |
, O_EXCL: 2048 | |
, O_NOCTTY: 131072 | |
, O_TRUNC: 1024 | |
, O_APPEND: 8 | |
, O_DIRECTORY: 1048576 | |
, O_NOFOLLOW: 256 | |
, O_SYNC: 128 | |
, S_IRWXU: 448 | |
, S_IRUSR: 256 | |
, S_IWUSR: 128 | |
, S_IXUSR: 64 | |
, S_IRWXG: 56 | |
, S_IRGRP: 32 | |
, S_IWGRP: 16 | |
, S_IXGRP: 8 | |
, S_IRWXO: 7 | |
, S_IROTH: 4 | |
, S_IWOTH: 2 | |
, S_IXOTH: 1 | |
, E2BIG: 7 | |
, EACCES: 13 | |
, EADDRINUSE: 48 | |
, EADDRNOTAVAIL: 49 | |
, EAFNOSUPPORT: 47 | |
, EAGAIN: 35 | |
, EALREADY: 37 | |
, EBADF: 9 | |
, EBADMSG: 94 | |
, EBUSY: 16 | |
, ECANCELED: 89 | |
, ECHILD: 10 | |
, ECONNABORTED: 53 | |
, ECONNREFUSED: 61 | |
, ECONNRESET: 54 | |
, EDEADLK: 11 | |
, EDESTADDRREQ: 39 | |
, EDOM: 33 | |
, EDQUOT: 69 | |
, EEXIST: 17 | |
, EFAULT: 14 | |
, EFBIG: 27 | |
, EHOSTUNREACH: 65 | |
, EIDRM: 90 | |
, EILSEQ: 92 | |
, EINPROGRESS: 36 | |
, EINTR: 4 | |
, EINVAL: 22 | |
, EIO: 5 | |
, EISCONN: 56 | |
, EISDIR: 21 | |
, ELOOP: 62 | |
, EMFILE: 24 | |
, EMLINK: 31 | |
, EMSGSIZE: 40 | |
, EMULTIHOP: 95 | |
, ENAMETOOLONG: 63 | |
, ENETDOWN: 50 | |
, ENETRESET: 52 | |
, ENETUNREACH: 51 | |
, ENFILE: 23 | |
, ENOBUFS: 55 | |
, ENODATA: 96 | |
, ENODEV: 19 | |
, ENOENT: 2 | |
, ENOEXEC: 8 | |
, ENOLCK: 77 | |
, ENOLINK: 97 | |
, ENOMEM: 12 | |
, ENOMSG: 91 | |
, ENOPROTOOPT: 42 | |
, ENOSPC: 28 | |
, ENOSR: 98 | |
, ENOSTR: 99 | |
, ENOSYS: 78 | |
, ENOTCONN: 57 | |
, ENOTDIR: 20 | |
, ENOTEMPTY: 66 | |
, ENOTSOCK: 38 | |
, ENOTSUP: 45 | |
, ENOTTY: 25 | |
, ENXIO: 6 | |
, EOPNOTSUPP: 102 | |
, EOVERFLOW: 84 | |
, EPERM: 1 | |
, EPIPE: 32 | |
, EPROTO: 100 | |
, EPROTONOSUPPORT: 43 | |
, EPROTOTYPE: 41 | |
, ERANGE: 34 | |
, EROFS: 30 | |
, ESPIPE: 29 | |
, ESRCH: 3 | |
, ESTALE: 70 | |
, ETIME: 101 | |
, ETIMEDOUT: 60 | |
, ETXTBSY: 26 | |
, EWOULDBLOCK: 35 | |
, EXDEV: 18 | |
, SIGHUP: 1 | |
, SIGINT: 2 | |
, SIGQUIT: 3 | |
, SIGILL: 4 | |
, SIGTRAP: 5 | |
, SIGABRT: 6 | |
, SIGIOT: 6 | |
, SIGBUS: 10 | |
, SIGFPE: 8 | |
, SIGKILL: 9 | |
, SIGUSR1: 30 | |
, SIGSEGV: 11 | |
, SIGUSR2: 31 | |
, SIGPIPE: 13 | |
, SIGALRM: 14 | |
, SIGTERM: 15 | |
, SIGCHLD: 20 | |
, SIGCONT: 19 | |
, SIGSTOP: 17 | |
, SIGTSTP: 18 | |
, SIGTTIN: 21 | |
, SIGTTOU: 22 | |
, SIGURG: 16 | |
, SIGXCPU: 24 | |
, SIGXFSZ: 25 | |
, SIGVTALRM: 26 | |
, SIGPROF: 27 | |
, SIGWINCH: 28 | |
, SIGIO: 23 | |
, SIGSYS: 12 | |
, debug: [Function] | |
, error: [Function] | |
, watchFile: [Function] | |
, unwatchFile: [Function] | |
, mixin: [Function] | |
, createChildProcess: [Function] | |
, inherits: [Function] | |
, assert: [Function] | |
, evalcx: [Function] | |
, _tickCallback: [Function] | |
, nextTick: [Function] | |
, Promise: [Function: removed] | |
, addListener: [Function] | |
, on: [Function] | |
, removeListener: [Function] | |
, stdout: [Getter] | |
, openStdin: [Function] | |
, exit: [Function] | |
, mainModule: [Circular] | |
} | |
, fun: [Function] | |
, pos: 1878 | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment