GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||
GeezerVison is showing github.com — util: fix inspect indentation of detached DataView by Kjubikstronk · Pull Request #66421 · nodejs/node Conversation
Contributor
const util = require('node:util'); const ab = new ArrayBuffer(4); const dv = new DataView(ab); structuredClone(ab, { transfer: [ab] }); console.log(util.inspect(dv)); The cause was The bug came in with #60131, and the test added there asserted the leaked output. Fix: read the value before indenting. I built Node on Windows and tested it: the changed test fails without the fix and passes with it, as do 428 related tests. I used Claude Code to find the bug and write the fix. I reviewed the diff and the changed assertion myself. Refs: #60131
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsformatExtraProperties() raised ctx.indentationLvl before reading the property. The getters of a detached DataView throw, so the level was never lowered again, and the DataView and everything inspected after it in the same call ended up indented too far. Read the value first. Signed-off-by: Miodrag Obradovic <[email protected]> Assisted-by: a closed-source coding agent
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
ljharb
approved these changes
|
There was an error while loading. Please reload this page.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@ ## main #66421 +/- ## ======================================= Coverage 90.37% 90.37% ======================================= Files 792 792 Lines 275683 275686 +3 Branches 52854 52854 ======================================= + Hits 249147 249159 +12 + Misses 16947 16935 -12 - Partials 9589 9592 +3
🚀 New features to boost your workflow:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Landed in 1ee5d29 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
formatExtraProperties() raised ctx.indentationLvl before reading the property. The getters of a detached DataView throw, so the level was never lowered again, and the DataView and everything inspected after it in the same call ended up indented too far. Read the value first. Signed-off-by: Miodrag Obradovic <[email protected]> Assisted-by: a closed-source coding agent PR-URL: #66421 Refs: #60131 Reviewed-By: Jordan Harband <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
formatExtraProperties() raised ctx.indentationLvl before reading the property. The getters of a detached DataView throw, so the level was never lowered again, and the DataView and everything inspected after it in the same call ended up indented too far. Read the value first. Signed-off-by: Miodrag Obradovic <[email protected]> Assisted-by: a closed-source coding agent PR-URL: #66421 Refs: #60131 Reviewed-By: Jordan Harband <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
formatExtraProperties() raised ctx.indentationLvl before reading the property. The getters of a detached DataView throw, so the level was never lowered again, and the DataView and everything inspected after it in the same call ended up indented too far. Read the value first. Signed-off-by: Miodrag Obradovic <[email protected]> Assisted-by: a closed-source coding agent PR-URL: #66421 Refs: #60131 Reviewed-By: Jordan Harband <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
formatExtraProperties() raised ctx.indentationLvl before reading the property. The getters of a detached DataView throw, so the level was never lowered again, and the DataView and everything inspected after it in the same call ended up indented too far. Read the value first. Signed-off-by: Miodrag Obradovic <[email protected]> Assisted-by: a closed-source coding agent PR-URL: #66421 Refs: #60131 Reviewed-By: Jordan Harband <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
formatExtraProperties() raised ctx.indentationLvl before reading the property. The getters of a detached DataView throw, so the level was never lowered again, and the DataView and everything inspected after it in the same call ended up indented too far. Read the value first. Signed-off-by: Miodrag Obradovic <[email protected]> Assisted-by: a closed-source coding agent PR-URL: #66421 Refs: #60131 Reviewed-By: Jordan Harband <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.