Skip to content

fix(node/vm): support vm.constants.DONT_CONTEXTIFY in createContext#32337

Merged
fraidev merged 3 commits intodenoland:mainfrom
fraidev:fix/vm-constants-dont-contextify
Feb 27, 2026
Merged

fix(node/vm): support vm.constants.DONT_CONTEXTIFY in createContext#32337
fraidev merged 3 commits intodenoland:mainfrom
fraidev:fix/vm-constants-dont-contextify

Conversation

@fraidev
Copy link
Copy Markdown
Contributor

@fraidev fraidev commented Feb 26, 2026

Closes #31192

Adds support for creating vanilla (non-contextified) V8 contexts via vm.createContext(vm.constants.DONT_CONTEXTIFY). This creates a context without property interceptors, where globalThis is reference-equal to the returned object and Object.freeze(globalThis) works correctly.

This is needed by libraries like jsdom that require contexts without interceptor overhead. The feature was added in Node.js v22.8.0.

Enables node_compat test: test-vm-context-dont-contextify.js

@fraidev fraidev force-pushed the fix/vm-constants-dont-contextify branch from 8931ab4 to fb46420 Compare February 26, 2026 20:19
@bartlomieju bartlomieju requested a review from devsnek February 26, 2026 20:41
@fraidev fraidev merged commit 2f42a46 into denoland:main Feb 27, 2026
110 checks passed
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.

node:vm does not not implement createContext correctly

2 participants