You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ran into this at some point recently as part of asserting with code - it's easy enough to avoid, but could still be useful to clarify which behavior is correct:
✔ ~/devel/projects/tmp
15:08 $ nvm use 6
Now using node v6.11.2 (npm v5.4.2)
✔ ~/devel/projects/tmp
15:08 $ node
> require('hoek').deepEqual(new Error(), new Error())
true
vs
✔ ~/devel/projects/tmp
15:08 $ nvm use 8
Now using node v8.5.0 (npm v5.4.2)
✔ ~/devel/projects/tmp
15:09 $ node
> require('hoek').deepEqual(new Error(), new Error())
false
It seems that in node 8 property descriptor for error.stack no longer has a get function, but rather has a value - which forces a different path - and the stackis different for the two errors, so possibly the previous behavior was incorrect?
The text was updated successfully, but these errors were encountered:
I think the new behavior is correct... these two errors are not the same since they are thrown from different places. If there is a valid use case for comparing error properties other than stack we could add an option to ignore some properties. But I think the old behavior was wrong.
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.
lockbot
locked as resolved and limited conversation to collaborators
Jan 9, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
bugBug or defectnon issueIssue is not a problem or requires changes
Ran into this at some point recently as part of asserting with
code
- it's easy enough to avoid, but could still be useful to clarify which behavior is correct:vs
It seems that in node 8 property descriptor for
error.stack
no longer has aget
function, but rather has avalue
- which forces a different path - and thestack
is different for the two errors, so possibly the previous behavior was incorrect?The text was updated successfully, but these errors were encountered: