Skip to content
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

bigint key in Map #1277

Closed
Reububble opened this issue May 18, 2022 · 2 comments · Fixed by #1278
Closed

bigint key in Map #1277

Reububble opened this issue May 18, 2022 · 2 comments · Fixed by #1278
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Milestone

Comments

@Reububble
Copy link

Description
Setting a key with type bigint in a Map makes the Map throw an error when viewed in the watch/variable pane, or when attempting to view it in the debug console. The error seen is:

Error processing variables: TypeError: Cannot read properties of undefined (reading 'length')
    at c:\Users\rwillson\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode.js-debug\src\extension.js:2:860531
    at h (c:\Users\rwillson\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode.js-debug\src\extension.js:2:860747)
    at d (c:\Users\rwillson\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode.js-debug\src\extension.js:2:858822)
    at Object.t.previewRemoteObject (c:\Users\rwillson\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode.js-debug\src\extension.js:2:863968)
    at U.toDap (c:\Users\rwillson\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode.js-debug\src\extension.js:2:959877)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at U.toDap (c:\Users\rwillson\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode.js-debug\src\extension.js:2:962103)
    at async Promise.all (index 5)
    at n.getVariables (c:\Users\rwillson\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode.js-debug\src\extension.js:2:967510)
    at j._onVariables (c:\Users\rwillson\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode.js-debug\src\extension.js:2:839447)
    at t.default._onMessage (c:\Users\rwillson\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\ms-vscode.js-debug\src\extension.js:2:1070672)

Although the debugger breaks in this way, the code still seems to function. i.e. The Map does contain the key value pair and retrieving it will return the correct result at runtime, even through the debug console.

To Reproduce
In a javascript file use the following code

const a = new Map();
a.set(1n, "value");
debugger; // break here

Run and debug using node. You will see that the variables tab shows the error. If you enter a into the debug console the same error appears there.

Log File
vscode-debugadapter-c1843209.json.gz

VS Code Version:
Version: 1.67.1 (user setup)
Commit: da15b6fd3ef856477bf6f4fb29ba1b7af717770d
Date: 2022-05-06T12:37:03.389Z
Electron: 17.4.1
Chromium: 98.0.4758.141
Node.js: 16.13.0
V8: 9.8.177.13-electron.0
OS: Windows_NT x64 10.0.18362

@Reububble Reububble added the bug Issue identified by VS Code Team member as probable bug label May 18, 2022
@Reububble
Copy link
Author

It might also be relevant that console.log(a) will not log anything to console when a contains a bigint key either

@connor4312
Copy link
Member

Good catch, thanks for the report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants