diff --git a/dev-packages/node-integration-tests/suites/public-api/LocalVariables/local-variables-caught.js b/dev-packages/node-integration-tests/suites/public-api/LocalVariables/local-variables-caught.js index 7c86004da43b..17923fe3ca46 100644 --- a/dev-packages/node-integration-tests/suites/public-api/LocalVariables/local-variables-caught.js +++ b/dev-packages/node-integration-tests/suites/public-api/LocalVariables/local-variables-caught.js @@ -20,6 +20,9 @@ function one(name) { name, num: 5, }; + const bool = false; + const num = 0; + const str = ''; const ty = new Some(); diff --git a/dev-packages/node-integration-tests/suites/public-api/LocalVariables/local-variables-caught.mjs b/dev-packages/node-integration-tests/suites/public-api/LocalVariables/local-variables-caught.mjs index 37e5966bc575..ed6032a0b84d 100644 --- a/dev-packages/node-integration-tests/suites/public-api/LocalVariables/local-variables-caught.mjs +++ b/dev-packages/node-integration-tests/suites/public-api/LocalVariables/local-variables-caught.mjs @@ -22,6 +22,9 @@ function one(name) { functionsShouldNotBeIncluded: () => {}, functionsShouldNotBeIncluded2() {}, }; + const bool = false; + const num = 0; + const str = ''; const ty = new Some(); diff --git a/dev-packages/node-integration-tests/suites/public-api/LocalVariables/local-variables-memory-test.js b/dev-packages/node-integration-tests/suites/public-api/LocalVariables/local-variables-memory-test.js index 7aa9feb9ae2a..4d88a85a17a3 100644 --- a/dev-packages/node-integration-tests/suites/public-api/LocalVariables/local-variables-memory-test.js +++ b/dev-packages/node-integration-tests/suites/public-api/LocalVariables/local-variables-memory-test.js @@ -22,6 +22,9 @@ function one(name) { name, num: 5, }; + const bool = false; + const num = 0; + const str = ''; const ty = new Some(); diff --git a/dev-packages/node-integration-tests/suites/public-api/LocalVariables/local-variables.js b/dev-packages/node-integration-tests/suites/public-api/LocalVariables/local-variables.js index 4a16ad89b5aa..11ebbd610fb0 100644 --- a/dev-packages/node-integration-tests/suites/public-api/LocalVariables/local-variables.js +++ b/dev-packages/node-integration-tests/suites/public-api/LocalVariables/local-variables.js @@ -24,6 +24,9 @@ function one(name) { name, num: 5, }; + const bool = false; + const num = 0; + const str = ''; const ty = new Some(); diff --git a/dev-packages/node-integration-tests/suites/public-api/LocalVariables/no-local-variables.js b/dev-packages/node-integration-tests/suites/public-api/LocalVariables/no-local-variables.js index f01e33a9cafa..88dadf0f853f 100644 --- a/dev-packages/node-integration-tests/suites/public-api/LocalVariables/no-local-variables.js +++ b/dev-packages/node-integration-tests/suites/public-api/LocalVariables/no-local-variables.js @@ -23,6 +23,9 @@ function one(name) { name, num: 5, }; + const bool = false; + const num = 0; + const str = ''; const ty = new Some(); diff --git a/dev-packages/node-integration-tests/suites/public-api/LocalVariables/test.ts b/dev-packages/node-integration-tests/suites/public-api/LocalVariables/test.ts index 3458d74f46b1..9fa649fe4106 100644 --- a/dev-packages/node-integration-tests/suites/public-api/LocalVariables/test.ts +++ b/dev-packages/node-integration-tests/suites/public-api/LocalVariables/test.ts @@ -16,6 +16,9 @@ const EXPECTED_LOCAL_VARIABLES_EVENT = { arr: [1, '2', null], obj: { name: 'some name', num: 5 }, ty: '', + bool: false, + num: 0, + str: '', }, }), expect.objectContaining({ diff --git a/packages/node/src/integrations/local-variables/local-variables-async.ts b/packages/node/src/integrations/local-variables/local-variables-async.ts index b5f015b2b7db..7b6ae38db292 100644 --- a/packages/node/src/integrations/local-variables/local-variables-async.ts +++ b/packages/node/src/integrations/local-variables/local-variables-async.ts @@ -42,9 +42,9 @@ async function unrollObject(session: Session, objectId: string, name: string, va } function unrollOther(prop: Runtime.PropertyDescriptor, vars: Variables): void { - if (prop?.value?.value) { + if (prop?.value?.value != null) { vars[prop.name] = prop.value.value; - } else if (prop?.value?.description && prop?.value?.type !== 'function') { + } else if (prop?.value?.description != null && prop?.value?.type !== 'function') { vars[prop.name] = `<${prop.value.description}>`; } } @@ -63,7 +63,7 @@ async function getLocalVariables(session: Session, objectId: string): Promise this._unrollObject(id, prop.name, vars, next)); - } else if (prop?.value?.value || prop?.value?.description) { + } else if (prop?.value?.value != null || prop?.value?.description != null) { add(vars => this._unrollOther(prop, vars, next)); } } @@ -192,9 +192,9 @@ class AsyncSession implements DebugSession { * Unrolls other properties */ private _unrollOther(prop: Runtime.PropertyDescriptor, vars: Variables, next: (vars: Variables) => void): void { - if (prop?.value?.value) { + if (prop?.value?.value != null) { vars[prop.name] = prop.value.value; - } else if (prop?.value?.description && prop?.value?.type !== 'function') { + } else if (prop?.value?.description != null && prop?.value?.type !== 'function') { vars[prop.name] = `<${prop.value.description}>`; }