Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

254
Vistas
Bluebird async.js throws error

When I debug my application and set it to breakpoint on all exceptions, it stops at line 3 in bluebirds async.js (link)

{throw new Error(); } catch (e) {firstLineError = e;}

That line strikes me as a little odd.

What's the purpose of it?

Thank you

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I would assume that it is there to get the error object of the first line to have some info about file names, paths and line numbers because things like this can be used for that. But I would have to look at the source code. It certainly looks interesting.

This is used in src/debuggability.js in the setBounds() function:

  • https://github.com/petkaantonov/bluebird/blob/master/src/debuggability.js#L690

that is called in this string that contains JavaScript which is presumably evaled somewhere:

  • https://github.com/petkaantonov/bluebird/blob/master/tools/build.js#L44-L66

This string is stored in a variable called lastLineCode. It seems that this all sets some scope for debugging to make sure that what is debugged is between the first line and the last line of the relevant part of the Bluebird source code, e.g. when it is combined with other modules.

You can look at some of those commits for more context of how it was added:

  • https://github.com/petkaantonov/bluebird/commit/74ced5b578e0e2574e62
  • https://github.com/petkaantonov/bluebird/commit/8fb54c51a935193d5329
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda