ref(utils): use test instead of indexof in stacktrace#7417
ref(utils): use test instead of indexof in stacktrace#7417AbhiPrasad merged 4 commits intodevelopfrom
Conversation
size-limit report 📦
|
packages/utils/src/stacktrace.ts
Outdated
| .reverse(); | ||
| return localStack.map(frame => ({ | ||
| ...frame, | ||
| filename: frame.filename || localStack[0].filename, |
There was a problem hiding this comment.
I am a bit puzzled why this has a fallback to localStack[0].filename?
There was a problem hiding this comment.
I'm not sure - this seems strange to me, and feels wrong. Shouldn't we just drop the filename if it's not set?
There was a problem hiding this comment.
Yeah, that is what I would assume. It seems like we were defaulting to the file at the root of the stack?
There was a problem hiding this comment.
I guess for now let's just keep the behaviour, but I'll make a TODO to come back and investigate this.
|
OK, I'm having some trouble with fixing this test... Even if I revert my implementation back to the original it still fails locally? I'm not entirely sure why this would be the case or if I'm maybe using this wrongly? I noticed that since the test depends on a different package I wanted to rebuild the package however I still cant see any logs 😢 |
678dcce to
e4e9db2
Compare
|
Let's merge this in for now and come back to take a look at the filename. |
We dont require the actual index + we can match with a single fn call