Skip to content

Fix node:v8 cachedDataVersionTag to be a function#6005

Merged
petebacondarwin merged 1 commit intomainfrom
fix-cachedDataVersionTag-to-function
Feb 3, 2026
Merged

Fix node:v8 cachedDataVersionTag to be a function#6005
petebacondarwin merged 1 commit intomainfrom
fix-cachedDataVersionTag-to-function

Conversation

@petebacondarwin
Copy link
Contributor

Summary

  • Fixes v8.cachedDataVersionTag to be a function that returns 0 instead of a constant 0
  • This aligns the workerd implementation with the Node.js API specification which defines v8.cachedDataVersionTag() as a function returning an integer

Changes

  • src/node/v8.ts: Changed export const cachedDataVersionTag = 0 to export function cachedDataVersionTag(): number { return 0; }
  • src/workerd/api/node/tests/v8-nodejs-test.js: Updated tests to verify it's a function and call it correctly

@anonrig anonrig force-pushed the fix-cachedDataVersionTag-to-function branch from 107ad2b to e766d28 Compare February 2, 2026 21:24
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 2, 2026

Merging this PR will improve performance by 13.17%

⚡ 1 improved benchmark
✅ 69 untouched benchmarks
⏩ 129 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
Encode_ASCII_32[TextEncoder][0/0/32] 3.4 ms 3 ms +13.17%

Comparing fix-cachedDataVersionTag-to-function (4d719ee) with main (fd62891)

Open in CodSpeed

Footnotes

  1. 129 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Per the Node.js documentation, v8.cachedDataVersionTag() should be a
function that returns an integer, not a constant. This change aligns
the implementation with the Node.js API specification.
@petebacondarwin petebacondarwin force-pushed the fix-cachedDataVersionTag-to-function branch from e766d28 to 4d719ee Compare February 3, 2026 15:36
@petebacondarwin petebacondarwin merged commit 84b65ee into main Feb 3, 2026
22 checks passed
@petebacondarwin petebacondarwin deleted the fix-cachedDataVersionTag-to-function branch February 3, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants