On Feb 13, 1:56 pm, Jann Horn <[email protected]> wrote:
> Doesn't that mean that plain async methods might be missing in the
> generated trace?

Yes, unfortunately.

It won't happen with low level async calls like fs.readFile, db calls,
etc. but it may happen if you have intermediate async functions to
which you pass async function arguments and if these intermediate
functions are not written with streamline. For example the 'g'
function in:

  function h(_) { process.nextTick(_); throw new Error("hello"); }
  function g(cb, fn) { fn(cb); }
  function f(_) { return g1(_, h); }
  try { f(_) } catch (ex) { console.log(ex.stack); }

On the other hand, it won't happen if g is written with streamline:

  function g(_, fn) { return fn(_); }

As all our code is written with streamline, we did not run into this.
Also, this won't happen if you run streamline in fibers mode.

And I'd rather live with this than penalize the runtime with a new
Error() on every async call.

Good catch!

Bruno

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to