caller icon indicating copy to clipboard operation
caller copied to clipboard

[Bug]: Babel/node got different results with node.js when using caller.js

Open chlshown opened this issue 3 years ago • 1 comments

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."

chlshown avatar Feb 14 '22 05:02 chlshown

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.

nicolo-ribaudo avatar Feb 16 '22 13:02 nicolo-ribaudo