caller
caller copied to clipboard
[Bug]: Babel/node got different results with node.js when using caller.js
Bug Detail: https://github.com/babel/babel/issues/14254
and Babel team said: "I suggest opening an issue in that package's repository asking to support polyfilled error constructors."
Note that this problem is not specific to Babel. Even if you don't use Babel, loading any Error
polyfill causes this package to stop working. I suggest a replacing https://github.com/totherik/caller/blob/96474d00dd1090b99c0d71c8a9e1f74c24436011/index.js#L20-L21 with a loop that first finds the last frame whose file is __filename
, and then subtracts the depth.