蓝鸟在源代码处抛出异常

Bluebird throwing exception at source code

我正在为 nodejs 应用程序使用 bluebirdjs。它从其源代码中抛出异常。

行:try {throw new Error(); } catch (e) {ret.lastLineError = e;}

路径:bluebird/js/release/util.js

行:374

这个例外对我来说似乎没有必要。它只会抛出异常。删除这一行是否合理?

相同的代码也存在于第 3 行的 async.js 中。

在 IE 中,Error 对象将不会有 .stack 属性,除非它通过 try catch。需要 .stack 属性 来查看代码在哪一行和文件中。

ret.lastLineError = new Error() 因此只能在 firefox 和 chrome

中工作