-
-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Exclude internal stack frames from littering error messages #213
base: main
Are you sure you want to change the base?
Conversation
@@ -2061,12 +2067,12 @@ | |||
//. Multiple constraints may be placed on a type variable by including | |||
//. multiple `TypeClass` values in the array (e.g. `{a: [Foo, Bar, Baz]}`). | |||
|
|||
// invalidArgumentsCount :: (TypeInfo, Integer, Integer, Array Any) -> Error | |||
// invalidArgumentsCount :: (TypeInfo, Integer, Integer, Array Any, Function) -> Error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: This line is too long now. Argument types should be moved into the argument list as is done with other functions.
@@ -239,6 +239,9 @@ | |||
// always2 :: a -> (b, c) -> a | |||
function always2(x) { return function(y, z) { return x; }; } | |||
|
|||
// captureStackTrace :: Assignable a => (a, Function) -> a | |||
var captureStackTrace = Error.captureStackTrace || noop; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the return type be Undefined
rather than a
? As written noop
should not be used here because it does not return its first argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, you're right. Error.captureStackTrace
does actually return undefined
.
I would love to see you revive this pull request, Aldwin. :) |
I probably will. I am aware if its existence, and it's one of many things on my ever-evolving to-do list. :P |
Opening the PR because I'm not sure when I'll get back to it, so it can serve as a start.
These changes show an approach to tackling issues like #64 and (maybe) #212 using
Error.captureStacktrace
from V8 to trim the stack frames that were created inside sanctuary-def to facilitate forming the Error away from the stack traces.