-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(node): Record local variables with falsy values, null
and undefined
#10821
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
Conversation
@@ -16,6 +16,9 @@ const EXPECTED_LOCAL_VARIABLES_EVENT = { | |||
arr: [1, '2', null], | |||
obj: { name: 'some name', num: 5 }, | |||
ty: '<Some>', | |||
bool: false, | |||
num: 0, |
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.
In case of a number, we would previously report '<0>'
instead of 0
. I think changing this should be okay but wanted to double check if there are implications to this change. Anyone have an idea?
size-limit report 📦
|
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.
lol one thing I'm realizing here: This change still filters out variables that are simply assigned undefined
or null
. Should we completely remove the definedness checks?
toString it 😅? |
null
and undefined
Should we backport this to v7? |
We previously didn't record local local variables with falsy values because we checked for truthiness instead of definedness when unrolling and serializing the variable values. This PR changes how we check for and extract variable properties to record
0
,''
,false
)null
undefined
Fixes implementations in
node
andnode-experimental
fixes #10815