AndreasMadsen / trace

Creates super long stack traces
https://trace.js.org
MIT License
194 stars 18 forks source link

trace & iojs, plans, compatibility? #13

Closed iliakan closed 9 years ago

iliakan commented 9 years ago

Is trace compatible with io.js? Or is it going to be?

If not, maybe there are other ways to get a long stack trace w/ io.js that @AndreasMadsen could advice being a member of the Tracing WG?

AndreasMadsen commented 9 years ago

trace supports io.js - if it doesn't then it is a bug.

AndreasMadsen commented 9 years ago

I see now that some stuff changed between 2.0.0 and io.js 2.0.1, I will update trace so it support the new API, shouldn't be too hard.

iliakan commented 9 years ago
require('trace');

function f(ms) {
  setTimeout(function() {
    throw new Error("BAH!");
  }, ms);
}

function g() {
  f(10);
}

g();

This shows the trace like:

.../trace/long-stack-trace.js:5
    throw new Error("BAH!");
          ^
Error: BAH!
    at null._onTimeout (.../trace/long-stack-trace.js:5:11)
    at Timer.listOnTimeout (timers.js:89:15)

I guess the trace should be longer?

io 1.8.1 trace 1.1.0

AndreasMadsen commented 9 years ago

Yeah, io.js 1.6.0 actually introduced a breaking change, such that the timers wouldn't allow long stack traces. Should work now, trace 1.2.0 is just released. Tell me if it don't work :)

iliakan commented 9 years ago

Thanks, it does work now :+1: